🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6106

Re: Expression Based Language

#6106
From: Colin Plumb
Date: Fri, 06 Jan 1989 06:24
37 lines
1376 bytes
Actually, defining the semantics of such things is easy.
A friend of mine did it in a language design where {} created first-class
procedures.  I.e. you didn't call

while(cond) {
	body...
}

you called

while ({cond}, {
	body
})

and while was defined as (in a C-like syntax, where "int foo()" means a
*procedure* not a pointer to one):

void while(bool test(), void body())
{
	if (test()) {
		body();
		while(test, body);
	}
}

which, was, of course, really written more like

void while (bool test(), void body)) =
{
	ifthen(test, {body; while(test, body)})
}

There was, of course, syntactic sugar to make this more usable, but
while and relatives were in fact not part of the language, merely part
of the standard library.
-- 
	-Colin (uunet!microsof!w-colinp)
Technical Details
Message-ID: <196@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!uw-beaver!microsoft!w-colinp
References: <3300001@uxg.cso.uiuc.edu> <3290002@hpctdls.HP.COM> <4505@xenna.Encore.COM> <2583@ficc.uu.net> <9310@ihlpb.ATT.COM> <11359@haddock.ima.isc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!uw-beaver!microsoft!w-colinp
From: w-colinp@microsoft.UUCP (Colin Plumb)
Newsgroups: comp.lang.misc
Subject: Re: Expression Based Language
Message-ID: <196@microsoft.UUCP>
Date: 6 Jan 89 06:24:46 GMT
References: <3300001@uxg.cso.uiuc.edu> <3290002@hpctdls.HP.COM> <4505@xenna.Encore.COM> <2583@ficc.uu.net> <9310@ihlpb.ATT.COM> <11359@haddock.ima.isc.com>
Reply-To: w-colinp@microsoft.UUCP (Colin Plumb)
Organization: Microsoft Corp., Redmond WA
Lines: 37
Confusion: Microsoft Corp., Redmond WA