-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Create CallExpression / High-Order Functions #628
Comments
12 tasks
sys27
changed the title
Create CallExpression
Create CallExpression / High-Order Functions
May 7, 2023
sys27
added a commit
that referenced
this issue
May 12, 2023
sys27
added a commit
that referenced
this issue
May 13, 2023
sys27
added a commit
that referenced
this issue
May 14, 2023
sys27
added a commit
that referenced
this issue
May 14, 2023
sys27
added a commit
that referenced
this issue
May 14, 2023
sys27
added a commit
that referenced
this issue
May 14, 2023
sys27
added a commit
that referenced
this issue
May 29, 2023
sys27
added a commit
that referenced
this issue
Jun 4, 2023
sys27
added a commit
that referenced
this issue
Jun 4, 2023
sys27
added a commit
that referenced
this issue
Jun 5, 2023
sys27
added a commit
that referenced
this issue
Jun 5, 2023
sys27
added a commit
that referenced
this issue
Jun 5, 2023
sys27
added a commit
that referenced
this issue
Jun 5, 2023
#628 - Create CallExpression / High-Order Functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a new result type for functions (
Lambda
)The
Lambda
object will represent a definition of a function without a name and will contain the list of parameters and the code of the function. It could be stored in the parameters collection or returned by other expressions.Add
CallExpression
All functions (except built-in) will be parsed as
CallExpression
, it will have a reference toLambda
object (the function to call) and the list of actual parameters to pass to the function.(f := (y) => sin(y))(pi)
->CallExpression(Lambda, Parameters)
f(pi)
->CallExpression
sin(pi)
->Sin
Update parser to support lambda functions.
(x) => sin(x)
/lambda = '(' parameters ')' '=>' expression
f := (x) => sin(x)
new type of function declaration???(f(x) := sin(x))(pi)
vs((x) => sin(x))(pi)
Update parser to support inline lambdas
Remove
UserFunction
UserFunctions will be reworked (partially replaced by
CallExpression
andLambda
). They will be stored in the existing parameter collection instead of a separate one. For example (the parameters collection):pi
->3.14
(NumberValue
)f
->(x) := sin(x)
(Lambda
)Support High-Order Functions:
f(a, b) := a(b)
f(sin, pi)
Update
TypeAnalyzer
,Simplifier
,Differentiator
Add references to all existing functions.
The text was updated successfully, but these errors were encountered: