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

Re: call/cc




   From: kragen@pobox.com (Kragen Sitaker)
   Date: Fri, 14 Dec 2001 17:19:41 -0500 (EST)
   
   Here's a little bit of interlingual comparison --- what does it take
   to construct a new anonymous function that adds its two arguments and
   apply it to two numbers?

Here's my entry---for ITS TECO, from MIT, circa 1980:

  3,5M(:I*+)

In case the control characters aren't showing up in your email
reader, I provide a transliteration here:

  3,5M(:I*^X+^Y$)

I make this to be 13 tokens:

  3 , 5 M ( : I * control-X + control-Y altmode )

where "altmode" is nowadays known better as "escape".

The meaning is roughly as follows:

3,5	two numeric arguments to the following command

M	execute the macro in the Q-register whose name follows

(	uh-oh!  it's not a named Q-register, but an anonymous one,
	whose value is computed by the following expression

:I	insert a string into the Q-register whose name follows
	(the string follows the name of the Q-register and is
	terminated by an altmode)

*	uh-oh!  it's not a named Q-register, but an anonymous one,
	whose contents after the operation (insert, in this case)
	will be delivered as a value

^X+^Y$	this is the string argument to the insert command

)	okay, we've done the expression, and the value is the
	string ^X+^Y, so it's time to execute that as a macro

^X	this produces as a value the first numeric argument to the macro

+	addition (duh)

^Y	this produces as a value the second numeric argument to the macro


--Guy