Re: Significant whitespace (was Re: Blogging sucks)

[prev] [thread] [next] [lurker] [Date index for 2005/10/14]

From: peter (Peter da Silva)
Subject: Re: Significant whitespace (was Re: Blogging sucks)
Date: 00:41 on 14 Oct 2005
I was being a bit tongue-in-cheek... but...

> I think I need more information here...  Can you point me somewhere that
> would help me explain what you are talking about?

OK: in Smalltalk, Postscript, Lisp, Forth, and most other languages that
are aggressively introspective and reflective, control structures are
defined in terms of operations that can be performed within the language.

They may be implemented in the compiler or interpreter in a more efficient
way, but that's an implementation detail. In practice you could build
them out of other control structures and blocks if you wanted to.

Smalltalk:
	(expression) ifTrue: [ block ] ifFalse: [ block ].

Postscript:
	expression { block } { block } ifelse

Lisp:
	(cond (expression code)
	      (expression code)
	      (expression code)
	      (t code))

Forth is a bit harder to see, but you can take my word for it that it's
got the same kind of capability to implement new control structures.

Basically, if you can implement control structures this way, then it's
inelegant to define them such that they don't work as if they're implemented
this way, this allowing them to be replaced or extended cleanly. Since
nobody would ever leave inelegant components in a language ...

There's stuff above here

Generated at 20:00 on 17 Oct 2005 by mariachi 0.52