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

Help with functor not running/illegal use of nesting operator #329

Open
Spainardzap opened this issue Oct 8, 2020 · 2 comments
Open

Help with functor not running/illegal use of nesting operator #329

Spainardzap opened this issue Oct 8, 2020 · 2 comments

Comments

@Spainardzap
Copy link

I am having trouble making this run:

code:
functor
export generic:Generic
define
fun {Generic Op InitVal N}
if N == 0 then InitVal
else {Op N {Generic Op InitVal (N-1)}}
end
end
end

error:
%************************* expansion error **********************
%**
%** illegal use of nesting marker
%**
%** in file "Oz", line 2, column 0
%** ------------------ rejected (1 error)

@layus
Copy link
Member

layus commented Oct 9, 2020

I guess you are missing the -c flag to ozc, right ?

@h7x4
Copy link
Contributor

h7x4 commented Sep 12, 2022

This is still an issue. It seems like the parser expects every functor to be bound to a name, which doesn't allow for unnamed top-level functors to exist.
It doesn't even get past the parser stage, where it tries to insert an implicit nesting marker.

context('functor definition' [pB 'functor' exprOrImplDollar star(funcDescr) 'end' pE])#fun{$ [P1 _ S Ds _ P2]}
fFunctor(S Ds {MkPos P1 P2})
end

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

No branches or pull requests

3 participants