Re: [sawfish] Re: The dark corners of rep



>> > In any case, that's another rep difference from Scheme -- it
>> > provides both `rplaca'/`rplacd' and `setcar'/`setcdr' -- the
>> > difference seems to be the return value.
>>
>> The names and return values of setc[ad]r seem to stem from Emacs
>> Lisp.  The return values of rplac[ad] are as in Common Lisp.
>
> Yes, I forgot to include the conclusion -- rep provides all four like
> elisp, but with different semantics for the latter two like Lisp.
>
>
>> (Scheme has set-c[ad]r! with undefined return values.)
>
> Right.
>
>
>> > (Using such mutation is a bad idea anyway,
>>
>> Sometimes it is useful for performance but care is required not to
>> mutate objects referenced from code that expects them to stay
>> constant.  And most code expects that.
>
> Right.  This is why in PLT Scheme there are boxes (similar to
> one-value cons cells) that are intended for mutation, and why you can
> define your own struct with mutable fields.  (The same philosophy goes
> in CLtL, as the part I quoted shows.)
>
>
>> > and using the result of a side-effect function is also a bad
>> > idea.)
>>
>> Only when the return value is undefined.  E.g., not using the result
>> of nreverse would be kind of strange.
>
> If the return value is unspecified (as it is in Scheme), then using
> the result is impossible.  (At least not for portable code.)  My point
> was that even if it is defined, it's a bad idea to have functions that
> both perform some side-effect and return some value.  What usually
> happens with most scheme implementations (where there is some specific
> "unspecified" value that you get back) is that the property of
> side-effect-ness tends to propagate -- a function that prints stuff
> will in most cases return that unspecified value since its last
> expression will be a print call; a function that mutates stuff will
> also return the unspecified value for similar reasons.  This avoids
> silently hiding bugs in that code that is supposed to do side effects
> is not usually mixed and confused with code that is computing some
> result.
>
> The flip side of this is making things a little inconvenient when you
> want to chain assignments -- but that's a really lame argument for
> encouraging sloppy coding style for that benefit.  It was even a
> common argument at some point that allowing `x = y = z = 0' in C is
> good because it allows the compiler to optimize the code.
>
> --
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                   http://www.barzilay.org/                 Maze is Life!
>


Let me just chime in as a happy sawfish user who has extensive
programming experience in various languages but does not know
lisp/scheme/etc at all.

I'm perfectly happy with rep in sawfish. All I need it for is writing
not more than 50 lines in my .sawfishrc and it was not hard to learn
it for this purpose given the tons of rep files coming with sawfish.
They can be used as an example.

The fact that rep is not lisp/scheme/whatever doesn't bother me. In
fact I couldn't care less. There are many applications which have
their own configuration syntax or full configuration languages.
Typically it's easy to learn them for the purpose of configuring the
application. The same is true for sawfish, as far as I'm concerned I'm
learning a configuration syntax and not a language.

If someone already knows lisp/scheme/etc they will pick up rep faster
and if they are bothered by the fact that it is not lisp/scheme/etc
than just forget about the superficial similarities and treat it as
something completely different. A lisp/scheme/etc expert is not
surprised to find that application X has a config syntax Y that is
different from lisp/scheme.

If someone doesn't know lisp/scheme/etc than he/she will not care that
rep is different.

All in all, since rep has been used so successfully in sawfish I think
it's completely misguided to suggest that it should be replaced by
something else just because it's different than the favorite language
of somebody.

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown


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