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

Q: how to make examples work using the -demo flag #31

Open
jkleiser opened this issue Nov 14, 2018 · 1 comment
Open

Q: how to make examples work using the -demo flag #31

jkleiser opened this issue Nov 14, 2018 · 1 comment
Labels

Comments

@jkleiser
Copy link

I just installed zygo v5.0.1 on my Mac (macOS 10.14.1), and when I try the example I found in the wiki

(def sn (snoopy asst: (hornet forecast: (weather desc:"sunny"))))

then I get

error in evalGeneratedFunction:4: Error calling 'infix': symbol `weather` not found
in infix:0
in __main:22

What may be the problem here?

@glycerine
Copy link
Owner

glycerine commented Nov 14, 2018

Yeah. Sorry this isn't clearer. It's perfectly natural to wonder why this would work at all. After all. Without a prior function definition, defmap, or registration of a Go struct, none of the snoopy, hornet, or weather calls should work. Nobody has defined those functions.

So what is going on. Well, there is a special flag for demo and testing purposes.

https://github.com/glycerine/zygomys/blob/master/zygo/cfg.go#L43

So the trick is, starting zygo with zygo -demo will register those functions, letting the example function.

@glycerine glycerine changed the title Error calling 'infix': symbol weather not found Q: how to make examples work using the -demo flag Nov 14, 2018
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