etng-r2/how-to-save-on-brackets.txt
author Tony Garnock-Jones <tonygarnockjones@gmail.com>
Wed, 16 Jan 2019 17:15:58 +0000
changeset 438 1fe179d53161
parent 263 3cba309393c7
permissions -rw-r--r--
Add missing primitive implementation for the plain interpreter.
263
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     1
So currently {} is non-self-capturing and [] is self-capturing. What
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     2
if instead, the keyword "rec" (either "record" (== object) or
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     3
"recursive") were used to introduce a self-binding/open-recursion?
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     4
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     5
{ x -> x + 1 }	       	  	    { x -> x + 1 }
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     6
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     7
rec { x -> x + 1 }		    [ x -> x + 1 ]
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     8
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
     9
It provides a nice place to put a name for self, too, if we decide
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
    10
that's a good idea:
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
    11
3cba309393c7 Half-way through experimentation with oo:fp:parsing language in etng-r2
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
parents:
diff changeset
    12
rec self { x -> x + 1 }