ogma
ogma copied to clipboard
[FEATURE] command suffixes
Description
Proposal for command suffixes which alter the characteristics of the command.
-
!
suffix: treat input into cmd asNil
. The main use case is for arithmetic operators which could be used like+ a b
rather than\a | + b
. It is especially useful when the input is to be used:Tuple 1 2 | + #i.t0 #i.t1
. Thought will need to be given to how this interacts with the compiler, since the cmd might work on any type but the input block input would change toNil
, which does not flow. Another option is to just have specialised commands using the syntax. -
?
suffix: make the command fallible If the command returns an eval error, returnsNone
, else returnsSome(T)
. Could be called aMaybe
orOption
type. Would like it to be defined in ogma, so will need generics implemented.