Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 3416 days ago | link | parent

Yeah, I see it as a poor design for 'is. Personally, I pretend strings are immutable, if only so I can use 'is without regret.

The fact that Arc's 'testify and 'case rely on 'is might be part of it. I and akkartik believe everything should be using 'iso whenever possible instead, and I think akkartik goes as far as to say that 'iso should be named "is" and 'is should be dealt with some other way. There was a recent discussion about replacing today's (iso a b) and (is a b) with (is a b) and (is (id a) (id b)) respectively, and that seems like a pretty nice idea.

1 point by akkartik 3416 days ago | link

Hmm, I hadn't considered renaming iso to is. wart still calls it iso; is no longer exists. (Since it's built atop Common Lisp you can just use eq when you truly need it.)

I like the name iso. is raises philosophical questions about what makes two things equal. iso neatly sidesteps them by evoking the precise image of structural equality.


The original discussion that led to the id idea:


1 point by rocketnia 3416 days ago | link

"Hmm, I hadn't considered renaming iso to is ."

Oh, oops. Sorry! XD I guess I figured that the name 'is is so good that something oughta use it. And for some reason, I'm not currently concerned that the name "is" should be restricted to the most picky kind of equality operator (as I was in that thread).


"iso neatly sidesteps them by evoking the precise image of structural equality."

Right now, I don't believe the purpose of 'iso is very precise either. I think a type's designer should extend 'iso with whatever makes intuitive sense for that type, just as long as it's still an equivalence relation. Guess I'm in an informal mood.


1 point by Pauan 3416 days ago | link

But but but, `is` is one less character! :P


1 point by _6502_ 3415 days ago | link

Mutable strings are indeed sort of "strange", especially given Lisp semantic for literals that is different for example from Python (in python the syntax "[1,2,3]" is a list literal, but is indeed equivalent to Lisp "(list 1 2 3)" and not to "'(1 2 3)", i.e. returns a new fresh list at each evaluation). Mutable literals is somewhat counterintuitive and in Python a similar problem happens with default values for parameters (i.e. "def foo(x=[1,2,3]):...") not because the literal is altered but because default value is evaluated only once at function definition time. This idea that what is in the program text is not in this case fixed is a trap in which newbies often fall...