From a82b0d9d2435cca72629c1e5e73cdcb89f728ac0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 1 Jan 2019 15:52:56 -0800 Subject: Added support for $(foo 1 baz 2) as a way to access (foo 1 baz 2)'s meaning. --- examples/how_do_i.nom | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/how_do_i.nom') diff --git a/examples/how_do_i.nom b/examples/how_do_i.nom index e3c58d6..d40c7f4 100644 --- a/examples/how_do_i.nom +++ b/examples/how_do_i.nom @@ -1,4 +1,5 @@ #!/usr/bin/env nomsu -V6.13.12.8 + # How do I... # Write a comment? Put a # and go till the end of the line # How do I write a multi-line comment? @@ -313,9 +314,9 @@ debug only: # Function literals look like: $x -> ($x * $x) say (best of [2, -3, 4, -8] according to ($x -> ($x * $x))) -# Or, you can use ((foo $)'s meaning) to access the function that gets called by (foo $) +# Or, you can use $(foo $) to access the function that gets called by (foo $) ($x squared) means ($x * $x) -say (best of [2, -3, 4, -8] according to (($ squared)'s meaning)) +say (best of [2, -3, 4, -8] according to $($ squared) # But nomsu was designed with flexible alternatives that are often better than passing functions. For example, instead of calling a key function on every item, you could instead define a macro -- cgit v1.2.3