[racket] setf in scheme

From: Razvan Rotaru (roti_343 at yahoo.com)
Date: Thu Dec 30 11:37:42 EST 2010

In what sense would they grow the language? By adding an abstractisation layer, 
or by building it in the language. 
It seems to me (correct me if I'm wrong) that implementing such thing in scheme 
is complex only because scheme does not have lvalues (as things that an 
expression can be evaluated to, that is).


Razvan



________________________________
From: Neil Van Dyke <neil at neilvandyke.org>
To: Razvan Rotaru <roti_343 at yahoo.com>
Cc: users at racket-lang.org
Sent: Thu, December 30, 2010 5:54:14 PM
Subject: Re: [racket] setf in scheme

Razvan Rotaru wrote at 12/30/2010 10:34 AM: 
I was just wondering whether there is anything like setf in scheme.
>
If you mean like "set!" to accept place lvalues, SRFI-17 is one example:

http://srfi.schemers.org/srfi-17/srfi-17.html

Implementing such a thing for a small, fixed set of places (like "car") using 
only macros is easy.

If, however, you want it extensible to new setters, I think you'd end up 
defining matching setting procedures and hanging them off the getter procedures 
as (depending on what your Racket or Scheme version has) symbol properties, 
record-type-as-procedure, or some similar feature.

Setters like this have sometimes seemed to me to provide a nice linguistic 
symmetry, but at the same time, they are growing the language quite a bit 
despite the appeal of simplicity.  In practice, I have never wanted to have 
setters.  IMHO.


-- 
http://www.neilvandyke.org/ 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101230/4509270c/attachment.html>

Posted on the users mailing list.