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

guard not implemented for lambda #10

Open
jsulmont opened this issue May 23, 2018 · 2 comments
Open

guard not implemented for lambda #10

jsulmont opened this issue May 23, 2018 · 2 comments
Assignees
Labels

Comments

@jsulmont
Copy link

jsulmont commented May 23, 2018

the following code:

def czad(a) = lambda(b) if (a+b = 0) = a+b 

czad(2)(-2) | czad(3)(4) | czad(0)(0)

fails to compile:

[ERROR] Can't compile:
 0: def czad(a) = lambda(b) if (a+b = 0) = a+b #
                              ^--- Syntax error at line 0 column 26: LAMBDA LEFT_PAREN RIGHT_PAREN WILDCARD
 (error code 178)
 1:
 2: czad(2)(-2) | czad(3)(4) | czad(0)(0)
 3:
@jsulmont jsulmont added the bug label May 23, 2018
@jsulmont jsulmont changed the title syntax error: error code 178 syntax error: guard not implemented for lambda Jun 4, 2018
@jsulmont jsulmont changed the title syntax error: guard not implemented for lambda guard not implemented for lambda Jun 4, 2018
@prepor
Copy link
Collaborator

prepor commented Jun 27, 2018

this is not a bug, even official orc doesn't have guards for lambda in their syntax definition (https://orc.csres.utexas.edu/documentation/html/refmanual/ref.syntax.EBNF.html)

what's the case of a guard for lambda? it can't have multiple clauses anyway, why not just put if into lambda's body itself

@jsulmont
Copy link
Author

jsulmont commented Jul 4, 2018

the EBNF syntax is quite outdated -- Orc-2.1.2 compiles/executes this code.

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

No branches or pull requests

2 participants