Re: [q-lang-users] problem with command line parsing
Brought to you by:
agraef
From: Tim H. <q...@st...> - 2008-01-03 12:29:48
|
"David Minor" <dah...@gm...> writes: > Hello Qusers, > With great travail I succeeded in compiling Q on my mac osx 10.3.4 > system (cannot upgrade because of unavailable ProTools drivers). Q > passed all of it's internal tests, but the most elementary examples in > the tutorials return errors, for example: > ==> sqr X = X*X; > sqr X=X*X > ==> sqr 2 > sqr 2 > ==> who > is my compilation broken or do I just not understand the syntax of the > language? The latter. You don't define functions interactively; write scripts for those. #!/usr/local/bin/q #! -c main || quit sqr X = X*X; main = printf "%d\n" $ sqr 2 || quit; gives: | zsh/scr9, potato 12:27PM temp/ % ./q.q | 4 | zsh/scr9, potato 12:28PM temp/ % HTH, ~Tim -- <http://spodzone.org.uk/> |