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/
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to