fib example broken
When I run ./fib.gk in the current version, it prints
#<function:48>
I'm on cygwin, and bash --version reports
bash --version
GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Umm. fib is still broken. Am I missing something?
If you're seeing the exact same problem still, you might be missing something and should pull again. If you're seeing a different flavor of broken, it might be related to the fact that you're on cygwin - you might be the first.
Works now. Thought I had pulled already, but I guess not! Thanks!
When Craig reported this, I couldn't run:
./gherkin -l fib.gk
After the change, this runs for me.
However, the original problem still fails to run for me:
./fib.gk
./fib.gk: line 3: syntax error near unexpected token `lst'
./fib.gk: line 3: ` (fn (lst & more)'
On Thu, Nov 21, 2013 at 2:04 PM, Craig Andera [email protected]:
Works now. Thought I had pulled already, but I guess not! Thanks!
— Reply to this email directly or view it on GitHubhttps://github.com/alandipert/gherkin/issues/15#issuecomment-29013188 .
I'm getting the same thing under OS X: ./fib.gk gives a syntax error. Works under cygwin.
I think this is related to the difference in shebang handling between OS X and Linux, but I'm not sure what the best way to proceed is.
In a nutshell, OS X appears to be passing the script contents (instead of the script path) to gherkin, and bash is trying to interpret the Lisp code.
One hack might be to check the first two characters of input and see if they're a shebang, and self-call with the canonical form.
I thought I pushed it already, but I guess not. So I would like to make a change so that gherkin doesn't need -l for the shebang line (/usr/bin/env behaves differently on different platforms with regard to dash arguments). In other words, the default is to treat positional arguments as files to run. I think that would make at least one case of shebangs less problematic. Sound reasonable?
@kanaka :+1: In the meantime re: the general weirdness of shebang, I propose we create an examples/ directory and add a "Running the Examples" section of the readme that demonstrates executing fib.gk and other examples via ./gherkin <examples/example.gk>.
At least then newcomers on most platforms will have a good tire-kicking experience.