-
Notifications
You must be signed in to change notification settings - Fork 0
The Lapis syntax
The Lapis syntax tries to be as much compatible with Ruby as possible. Lapis code feels almost exactly like Ruby, since programs are visually just functions chained as if they were methods (this is actually the exact way pipes are implemented in Lapis).
Despite my best effort, as of now Lapis differs from Ruby in a few more or less major ways. This page attempts to document all known problems with the current Lapis syntax.
Not all of these can/will be fixed, but most of these are here just because the project is in a very alpha stage.
Lapis program pipes require the method call operator (the .
) to be separated from the first element of the pipe to work.
This is only for programs. Functions are unaffected, including user-defined functions.
The aforementioned problem is a bug and will be fixed.
Since most UNIX-style programs use -
and --
as program argument prefixes, in Lapis the unary -
operator, which normally negates an integer, has a different semantics, illustrated in the following example.
The unary minus semantics will not be adjusted.
In Lapis, anything that looks like a variable is checked internally to see if it's defined as such. If it's not, it's treated like a program argument, i.e. a bareword.
However, trying to pass a variable to grep_fn
as defined above fails. This is an bug and will be fixed.