Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: initial ast for program, comment, variable, reassignment #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jschatz1
Copy link

@jschatz1 jschatz1 commented Oct 3, 2022

Initial AST for program, comments, variable declarations, and variable reassignment.

@jschatz1
Copy link
Author

jschatz1 commented Oct 6, 2022

One thing I am not sure of is if "everything is a function" in foi or not. @getify what's your thoughts?

@getify
Copy link
Owner

getify commented Oct 6, 2022

@jschatz1

No, not everything is a function.

For example, empty, import, def, deft, defn, over, as, and default are all keywords. We also values, like numbers and strings, as well as records and tuples, and those are all definitely not functions.

However, all operators are functions, and most non-identifier symbols are operators/functions. For example, the . looks like it might be a special syntax, but it's actually a binary accessor-operator, so x.1 can also be done as | . x 1 |. Same with the .. tuple-range operator and the ... spread operator.

Exceptions: the ; and : separators, the , comma (list separator), sigils like ^ (return) / & (pick) / % (map-field), the # pipeline topic / def-block context, the -> function-return-type marker, and several sets of paired delimiters like " double-quotes (string delimiters), | | evaluation-expression (lisp) form, < and > record/tuple delimiters, <{ }>, { }, [ ], ( ), ?/ /, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On hold Inactive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants