[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Destructuring syntax



As JONL has pointed out, therte are only three &mumbles of
interest.  We can ignore &AUX by fiat, and &REST is the same
(in some sense) as ".", so that leaves &OPTIONAL.  I might suggest
extending JONL's BNF slightly to allow non-top-level &OPTIONALs:
	<vsymbol> ::= symbol-for-a-variable
	<dvar> ::= <vsymbol> | <bvl>
	<ivar> ::= <vsymbol> | (<dvar> <form>) | (<dvar> <form> <vsymbol>)
	<bvl> ::= ( {<dvar>}* [&OPTIONAL {<ivar>}+] [<rest>])
	<rest> ::= . <vsymbol> | &REST <vsymbol>
where square brackets mean 0 or 1 of, {...}* means 0 or more of,
and {...}+ means one or more of.

Adding &OPTIONAL into RMS's syntax is more difficult.  I'm working
on that.  May not be worth it?