Re: Where is the syntax error
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <CAOOOohSawDRfoT8D0jSbYRNicJYa+=RWiDxfo85QEuK=19MQ-g@mail.gmail.com> |
Dear Roelof, it appears you're submitting an OCaml expression to a bash interpreter, who alas doesn't understand it natively. Please enter the very same string to an ocaml interpreter, like ocaml or utop, and this should work perfectly. One note though : you should use "<>" instead of "!=", the former referring to structural (in)equality and the second to physical (in)equality. While in this particular case (with ints) the two are equivalent, this could bite you with more complex values. Cheers, Philippe. 2015-02-27 9:56 GMT+01:00 Roelof Wobben [email protected] [ocaml_beginners] <[email protected]>: > > > Hello, > > As a exercise of Ocaml from the very beginning I have to write a function > which display true if both are non zero . > > So I tried this : > > let both_zero a b = a != 0 || b !=0 ;; > > But I see then this very cryptic error message: > > bash: syntax error near unexpected token `;; > > Roelof > > > > >