[plt-scheme] dots

From: Jos Koot (jos.koot at telefonica.net)
Date: Sun Jun 10 12:43:42 EDT 2007

Jens Axel Soegaard pointed me to the idea. Like he did, I first tried to do all 
the work during expansion time. This is not possible however, as shown in an 
earlier thread on this subject. The hard part was getting loose of my fixation 
on expansion time solutions. Once I relaxed from this fixation, it was just a 
matter of develloping the idea. Initially I made a simple module with none or 
one super-type only, but then I saw that a relatively simple extension allows 
derivation from more than one supertype. The drawback of transferring the main 
part of the solution to run time is slower execution, of course.

I have to say that the module does not only add. It also strips: it prohibits 
the use of variables containing periods. In the most recent version of the 
module, all binding forms are adapted such as to refuse such variables (assuming 
I did not forget some).  That may cause trouble when using libraries that 
provide such variables (as a lucky circumstance, mzscheme does not (as at this 
moment)) A one character change of the source code allows choosing another 
character in stead of the period. The central idea is that when variables with 
periods are prohibited, the dot notation appears to mzscheme as an undefined 
variable and therefore is wrapped as (#%top . dot-notation). Redefining #%top 
does the main part of the job during expansion. Syntaxes set! and set!-values 
are redefined too, of course.
Hope this answers your question. Thanks for your interest.
Jos Koot
(http://www.telefonica.net/web2/koot/records.zip (40 kb, source code plus 
documentation (msword)))

----- Original Message ----- 
From: "Grant Rettke" <grettke at acm.org>
To: "Jos Koot" <jos.koot at telefonica.net>
Cc: "Chongkai Zhu" <czhu at cs.utah.edu>; "PLT-list" <plt-scheme at list.cs.brown.edu>
Sent: Sunday, June 10, 2007 6:03 PM
Subject: Re: [plt-scheme] dots

> Interesting. How difficult was it to add dot notation?
> On 6/9/07, Jos Koot <jos.koot at telefonica.net> wrote:
>> ----- Original Message -----
>> From: "Chongkai Zhu" <czhu at cs.utah.edu>
>> To: "Jos Koot" <jos.koot at telefonica.net>; "PLT-list"
>> <plt-scheme at list.cs.brown.edu>
>> Sent: Sunday, June 10, 2007 12:39 AM
>> Subject: Re: [plt-scheme] dots
>> > This looks cool. Why don't you submit it to PLaneT?
>> Thanks, I might after I am sure it does not contain too many bugs. Of course 
>> I
>> did many tests, but my experience is that other people always find tests that
>> expose other bugs. Kind regards, Jos Koot
>> >
>> > Chongkai
>> >
>> > ----- Original Message -----
>> > From: Jos Koot
>> > To: PLT-list
>> > Sent: Saturday, June 09, 2007 4:41 PM
>> > Subject: [plt-scheme] dots
>> >
>> >
>> > Interested in structs with multiple supertypes and dot-notation? I call 
>> > them
>> > 'records'. Be my guest at:
>> > http://www.telefonica.net/web2/koot/records.zip (40 kb, source code plus
>> > documentation (msword))
>> > Kind regards, Jos Koot
>> >
>> _________________________________________________
>>   For list-related administrative tasks:
>>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.