[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a meta-comment

This page is part of the web mail archives of SRFI 17 from before July 7th, 2015. The new archives for SRFI 17 contain all messages, not just those from before July 7th, 2015.

>First, does anyone want to speak up on Alternative 1 vs Alternative 2?
>My current inclination is Alternative 1, and unless there is ground-swell
>of support for Alternative 2, the final SRFI will use Alternative 1.

I'm no expert in scheme but I came to the same question last year for my 
own lisp and its setf syntax.

Generally I can say that Alternative-3 (A3, ie. new-value first) is 
semantically most compatible with old, existing functions, 
A2 (ie. new-value second) maybe more efficient and A1 (ie. new-value last) 
more compatible to newer lisp functions, such functions on vectors and 

BTW: A3 is something like subst uses and which was semantically the best 
these days:
   (subst new old tree) "change to new from old in ..."
=> (setf (tree-find old tree) new)
As you can see A1 is the most appealing way to express this now.

new-value last seems to be easier to learn. This was my main issue in 
designing new setf functions.

  (get-obj obj :color) =>
  (set-obj! obj :color 1) seems to be better than (change 1 :color obj),
aeh (set-obj! 1 :color obj) or other permutations. 

  "find what where" to "change the object to have color 1"

So the natural mapping would be A1 to me.
Reini Urban