In article <joswig-ya023180000804970632340001@news.lavielle.com>,
Rainer Joswig <joswig@lavielle.com> wrote:
> In article <5ic0qc$ene@psychotix.cs.uoregon.edu>, jhobbs@cs.uoregon.edu
> (Jeffrey Hobbs) wrote:
>> In article <5ibl1p$5et$2@csnews.cs.colorado.edu>,
>> Tom Christiansen <tchrist@mox.perl.com> wrote:
>>> fellowsd@cs.man.ac.uk (Donal K. Fellows) writes:
>>>> toplevel .t
>>>> button .t.b -text Hi! -font {Times 16} -command {puts "Pressed at
>>>> (%x,%y)"}
>>>> pack .t.b -fill both -expand 1
>>>>
>>>> How much extra Lisp would be needed to achieve this?
>
> This depends on the GUI toolkit you would use and has nothing
> to do with Lisp.
I'm particularly interested in how the "command" callback is handled,
and especially how the Lisp-like language specifies what information
from the event is passed to the callback, and in what order.
Hmm. I just spotted a bug in my code (which nobody pointed out... :^)
and I would like to change from using a button to a label (with no
default event bindings):
toplevel .t
label .t.msg -text Hi! -font {Times 16}
frame .t.band -height 20 -width 10 -bg red
pack .t.msg .t.band
bind .t <ButtonPress-1> {puts stdout "Pressed %W at (%x,%y)"}
The only line I'm really interested in is the binding line (the others
merely set the stage, and I have seen reasonable transcriptions in
other languages)
>> Yes and no. Some of the discussion has wandered off the main thrust of JO's
>> paper, but Donal's point here is LOC (or perhaps more generally syntactic
>> simplicity). The use of Tk here proves a point because Tk has been grafted
>> onto so many other languages. The example above is written most "plainly"
>> (concisely / fewest chars with greatest clarity / ...) when written in Tcl.
>
> Is "fewer chars" is a meaningful criteria for software quality?
Not in and of itself, but I'd add that failing to add needless
verbosity is probably a good thing (of course, the key is in the word
"needless" :^)
> I'd rather prefer readability and fewer implicit assumptions.
I can definitely think of cases where these do not go together, and
where the application of either actually worsens quality (a truly
frightening thought, admittedly). As always, correct design takes
thought and planning...
> I'd also prefer layout in declarative formats. etc. etc.
I can't rebut this, as I don't understand your meaning well enough!
Donal.
--
Donal K. Fellows http://r8h.cs.man.ac.uk:8000/ (SAY NO TO COMMERCIAL SPAMS!)
(work) fellowsd@cs.man.ac.uk Dept. Comp. Sci, Univ. Manchester, U.K.
| donal@ugglan.demon.co.uk 6,Randall Place, Heaton, Bradford, U.K. (home)
+-> ++44-161-275-6137 Send correspondence to my office ++44-1274-401017 <-+
|