diff options
Diffstat (limited to 'lib/training_wheels.nom')
| -rw-r--r-- | lib/training_wheels.nom | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/lib/training_wheels.nom b/lib/training_wheels.nom index 6155069..f16b700 100644 --- a/lib/training_wheels.nom +++ b/lib/training_wheels.nom @@ -1,26 +1,28 @@ -#!/usr/bin/env nomsu -V4.8.8.6 +#!/usr/bin/env nomsu -V4.8.10 # This file contains a set of definitions that bring some familiar language features from other languages into nomsu (e.g. "||" and "continue") -parse [%a === %b] as ((%a 's id) is (%b 's id)) -parse [%a !== %b] as ((%a 's id) is not (%b 's id)) -parse [function %names %body, def %names %body] as (action %names %body) -parse [switch %branch_value %body] as (if %branch_value is %body) -parse [None, Null] as (nil) -parse [True, true] as (yes) -parse [False, false] as (no) -parse [pass] as (do nothing) -parse [%a || %b] as (%a or %b) -parse [%a && %b] as (%a and %b) -parse [continue] as (do next) -parse [break] as (stop) -parse [let %thing = %value in %action] as (with local {%thing:%value}) -parse [print %, println %] as (say %) -parse [error!, panic!, fail!, abort!] as (barf!) -parse [error %, panic %, fail %, abort %] as (barf %) -parse [assert %condition] as (assume %condition) -parse [assert %condition %message] as (assume %condition or barf %message) -parse [%cond ? %if_true %if_false] as (%if_true if %cond else %if_false) -parse [lambda %args %body] as (%args -> %body) -parse [function %name %args %body] as (%name = (%args -> %body)) +(%a === %b) parses as ((%a 's id) is (%b 's id)) +(%a !== %b) parses as ((%a 's id) is not (%b 's id)) +[function %names %body, def %names %body] all parse as (..) + externally %names means %body + +(switch %branch_value %body) parses as (if %branch_value is %body) +[None, Null] all parse as (nil) +[True, true] all parse as (yes) +[False, false] all parse as (no) +(pass) parses as (do nothing) +(%a || %b) parses as (%a or %b) +(%a && %b) parses as (%a and %b) +(continue) parses as (do next) +(break) parses as (stop) +(let %thing = %value in %action) parses as (with local {%thing:%value}) +[print %, println %] all parse as (say %) +[error!, panic!, fail!, abort!] all parse as (barf!) +[error %, panic %, fail %, abort %] all parse as (barf %) +(assert %condition) parses as (assume %condition) +(assert %condition %message) parses as (assume %condition or barf %message) +(%cond ? %if_true %if_false) parses as (%if_true if %cond else %if_false) +(lambda %args %body) parses as (%args -> %body) +(function %name %args %body) parses as (%name = (%args -> %body)) |
