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

Re: a note on notations



> I have though of something which goes against both $ and %.  In
> practice, <>{foo} is loosely related to `{foo}, so one should be able
> to replace it with <>foo.

checkout the grammar.  <>foo works just fine in es-.08; it's used all
over the place in initial.es, normally as <>$&primitives.

> This cannot be the case for either $ or %
> as $foo and %foo already have essential meanings.

no, but
	; echo % true
	0
	; echo %(false)
	1
	; 
[note that the fact that i have an implementation of % replacing <> does
not mean that's what it's going to be.  i just wanted to try it out.]

> There isn't much
> left on the keyboard. 

amen.

> Mind you, I think `foo is an ugly short cut, and I'd be very happy to 
> see it dropped from es (and ``, for that matter).

i disagree.  i can't tell you how many times Byron and I have congratulated
ourselves on how nicely this addition to rc (later brought to es) works.

> While we're messing about with es' tokens, is there anyone else who
> finds $&foo both ugly and visually confusing and would rather have it
> replaced with %%foo (for `doubly primitive')?  Does applying a
> primitive really have enything to do with `lookup' or `evaluation'?

$& has everything to do with lookup:  it looks up a procedure pointer
in a dictionary of primitives.  see prim.c.

$& is one of those things that you should almost never type.  it's almost
always better to use $fn-%create for $&create, because then you get the
current definition, which may be spoofed.  that $& is ugly doesn't bother
me because 90% of its uses should be in initial.es.

also, as a side note, $& would otherwise be illegal syntax in es, which is
why we felt comfortable using it for primitives.  we sacrificed no useful
sequence, unlike : and %.

paul