<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Hi,</DIV>
<DIV>Finally I managed to prepare a language for dotted struct-field-references
and assignments that do what I want them to do. See attachments. For
example:</DIV>
<DIV>(module example records</DIV>
<DIV> (define-values (make-person person?)</DIV>
<DIV> (make-record-type 'person #f '(name maried-with
children)))<BR> (define jacob (make-person 'jacob #f ()))<BR> (define
maria (make-person 'maria #f ()))<BR> (define (mary man
woman)<BR> (set! man.maried-with woman)<BR> (set!
woman.maried-with man))<BR> (define (birth mother father
name)<BR> (let ((child (make-person name #f ())))<BR>
(set! mother.children (cons child mother.children))<BR> (set!
father.children (cons child father.children))))<BR> (define
(names-of-children person)</DIV>
<DIV> (map (lambda (person) person.name)
person.children))<BR> (mary jacob maria)<BR> (birth maria jacob
'son)<BR> (birth maria jacob 'doughter)<BR> (printf "~s~n"
(names-of-children maria)))</DIV>
<DIV>(require example) ;prints (doughter son)</DIV>
<DIV> </DIV>
<DIV>BUT this has a high price: field-names must be looked up during
run-time such as to relate them to those of the structure actually
present in the variable of the field-ref
variable.field-name.field-name.field-name etc.</DIV>
<DIV>Because of this required lookup, it makes no sense to memorize accessor and
mutator procs. In stead I made the lookup directly access an assoc-list that
pairs field-names with their values.</DIV>
<DIV> </DIV>
<DIV>I am still working on a mod that allows (lambda (person) person.name) to be
written as .name This should not be too difficult.</DIV>
<DIV> </DIV>
<DIV>(((((lambda(x)((((((((x x)x)x)x)x)x)x)x))<BR>
(lambda(x)(lambda(y)(x(x y)))))<BR> (lambda(x)(x)x))<BR>
(lambda()(printf "Greetings, Jos~n"))))</DIV></BODY></HTML>