Path: news.daimi.aau.dk!jacobse From: jacobse@daimi.aau.dk (Jacob Seligmann) Newsgroups: comp.lang.beta Subject: Re: BETA and X-Windows (was: Re: LISP and X-Windows) Date: 26 Sep 1994 09:32:50 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 68 Message-ID: <3664g2$81s@belfort.daimi.aau.dk> References: <35bn78$ms@belfort.daimi.aau.dk> <362dfc$84v@network.ucsd.edu> NNTP-Posting-Host: sorbus.daimi.aau.dk Matt Kennel (mbk@inls1.ucsd.edu) wrote: > Jacob Seligmann (jacobse@daimi.aau.dk) wrote: > > Peter da Silva wrote: > > > Jacob Seligmann wrote: > > > > > > > AwEnv(# do (&label(# init:: (# do 'Hello world' -> label #) #)[]).init #) > > > > > > [...] > > > > It's a complex combination, and it's complex to read (especially when > > written as a one-liner, and even more so if you're unfamiliar with the > > terse syntax), but I still believe it is an excellent demonstration of > > BETA's orthogonality. > > Orthogonal to my brain, certainly. ;-) :-) > I'm a newbie---could you "deconstruct" this one-liner? Sure, here we go: The one-liner instantiates an object inheriting from the Athena Widget X11 environment [AwEnv (# ... #)] with the following action-part [do]: Create a new object and return its reference [&... and ...[]], then call the init-operation pertaining to that reference [(...).init], the new object being a specialized label-object [label(# ... #)] whose spezialization consists of a final-binding its virtual init-attribute [init:: (# ... #)] to perform an assignment to its label-attribute ['Hello World' -> label]. Succesively easier-to-read versions of the program would therefore be AwEnv (# hello: label(# init:: (# do 'Hello World' -> label #) #) do (&hello[]).init #) AwEnv (# hello: @label(# init:: (# do 'Hello World' -> label #) #) do hello.init #) AwEnv (# hello: @label do hello.init; 'Hello World' -> hello.label #) Actaully, the last version is significantly shorter than my original one-liner (especially if "hello" is replaced by simply "h"), but since it's not a single expression, I'm not sure if it counts... I hope this helps! /Jacob Seligmann ------------------------------------------------------------------------ Mjolner Informatics ApS Phone: (+45) 86 20 20 00 ext. 2754 Science Park Aarhus Direct: (+45) 86 20 20 11 - 2754 Gustav Wieds Vej 10 Fax: (+45) 86 20 12 22 DK-8000 Aarhus C, Denmark Email: jacobse@mjolner.dk ------------------------------------------------------------------------ BETA is betta' ------------------------------------------------------------------------