ogma icon indicating copy to clipboard operation
ogma copied to clipboard

[FEATURE] command suffixes

Open kurtlawrence opened this issue 2 years ago • 0 comments

Description

Proposal for command suffixes which alter the characteristics of the command.

  • ! suffix: treat input into cmd as Nil. 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 to Nil, 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, returns None, else returns Some(T). Could be called a Maybe or Option type. Would like it to be defined in ogma, so will need generics implemented.

kurtlawrence avatar Mar 18 '22 21:03 kurtlawrence