{"action":"created","issue":{"url":"https://api.github.com/repos/keean/zenscript/issues/11","repository_url":"https://api.github.com/repos/keean/zenscript","labels_url":"https://api.github.com/repos/keean/zenscript/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/keean/zenscript/issues/11/comments","events_url":"https://api.github.com/repos/keean/zenscript/issues/11/events","html_url":"https://github.com/keean/zenscript/issues/11","id":178798168,"number":11,"title":"Syntax summary","user":{"login":"shelby3","id":247731,"avatar_url":"https://avatars0.githubusercontent.com/u/247731?v=3","gravatar_id":"","url":"https://api.github.com/users/shelby3","html_url":"https://github.com/shelby3","followers_url":"https://api.github.com/users/shelby3/followers","following_url":"https://api.github.com/users/shelby3/following{/other_user}","gists_url":"https://api.github.com/users/shelby3/gists{/gist_id}","starred_url":"https://api.github.com/users/shelby3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelby3/subscriptions","organizations_url":"https://api.github.com/users/shelby3/orgs","repos_url":"https://api.github.com/users/shelby3/repos","events_url":"https://api.github.com/users/shelby3/events{/privacy}","received_events_url":"https://api.github.com/users/shelby3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1109,"created_at":"2016-09-23T06:47:56Z","updated_at":"2017-03-14T09:07:48Z","closed_at":null,"body":"I will maintain in this OP a summary of current proposed syntax as I understand it to be. Note this is not authoritative, subject to change, and it may be inaccurate. Please make comments to discuss.\n\n`: Type` is always optional.\n1. [Sum, Recursive](http://stackoverflow.com/questions/5911267/what-are-sums-and-products-data-structures), [Record](https://github.com/keean/zenscript/issues/1#issuecomment-249349283), and [Product](https://github.com/keean/zenscript/issues/1#issuecomment-249348936) parametrized data type with optional Record member names and optional Record (e.g. `Cons`) and Product (e.g. `MetaData`) names:\n   \n   `data List<T> = MetaData(Nil | Cons{head: T, tail: List<T>}, {meta: Meta<T>})`\n2. Typeclass interface and implementation:\n   \n   ```\n   typeclass Name<A<B>, ...>   // or 'pluggable'?; optional <B> for higher-kinds¹?\n     method(B): A<B>           // TODO: add default arguments, named arguments?\n   \n   List<A> implements Name\n     method(x) => ...\n   ```\n3. References:\n   \n   ```\n   let x:Type = ...      // final assignment, not re-assignable (same as const in ES5/6)\n   var x:Type = ...      // (same as let in ES5/6)\n   ```\n4. Functions:\n   \n   Type parameters [do not require declaration](https://github.com/keean/zenscript/issues/6#issuecomment-248742773) `<A,B>`.\n   \n   ```\n   someCallback(x:Type y:Type(:Type) => x + y)     //            also  ():Type => x + y\n   var f = x:Type y:Type(:Type) => x + y           // not named, also  ():Type => x + y\n   f = x:Type y:Type(:Type) => x + y               // not named, also  ():Type => x + y\n   let f(x:Type, y:Type):Type => x + y             // named f,   also f():Type => x + y\n   let parametrized(x: A, y: B):A|B => x || y\n   let parametrizedWhere(x: A, y: B):A|B where ... => x || y\n   ```\n   \n   Note that iterator types can be specified for the return value to return a lazy list as a generalized way of implementing generators. The optional `(:Type)` is necessited for [generator functions](https://github.com/keean/zenscript/issues/17). Note the `(x: Type y: Type): Type => x + y` form [is unavailable](https://github.com/keean/zenscript/issues/11#issuecomment-249770741).\n5. [Assignment-as-expression](https://github.com/keean/zenscript/issues/6#issuecomment-248744745):\n   \n   ```\n   if ((x = 0))      // force extra parenthesis where expected type is Boolean\n   ```\n\n† Not yet included in the syntax, as would be a premature optimization. May or may not be added.\n¹ https://github.com/keean/zenscript/issues/10\n"},"comment":{"url":"https://api.github.com/repos/keean/zenscript/issues/comments/286361894","html_url":"https://github.com/keean/zenscript/issues/11#issuecomment-286361894","issue_url":"https://api.github.com/repos/keean/zenscript/issues/11","id":286361894,"user":{"login":"shelby3","id":247731,"avatar_url":"https://avatars0.githubusercontent.com/u/247731?v=3","gravatar_id":"","url":"https://api.github.com/users/shelby3","html_url":"https://github.com/shelby3","followers_url":"https://api.github.com/users/shelby3/followers","following_url":"https://api.github.com/users/shelby3/following{/other_user}","gists_url":"https://api.github.com/users/shelby3/gists{/gist_id}","starred_url":"https://api.github.com/users/shelby3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelby3/subscriptions","organizations_url":"https://api.github.com/users/shelby3/orgs","repos_url":"https://api.github.com/users/shelby3/repos","events_url":"https://api.github.com/users/shelby3/events{/privacy}","received_events_url":"https://api.github.com/users/shelby3/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T09:07:48Z","updated_at":"2017-03-14T09:07:48Z","body":"Note I added:\r\n\r\n> Arbitrary and not making sense to _every_ human are not the same concept. It is impossible to make anything which makes sense to absolutely everyone.\r\n> \r\n> > 1. It doesn't need to make sense why `<b>` is `<bolded>` (in HTML) and `Fn` is `function` (in Rust). Programmers can remember syntax."}}
{"actor":{"display_login":"shelby3"}}