Arc Forumnew | comments | leaders | submitlogin
1 point by Pauan 4724 days ago | link | parent

"Can you set the car of a string to an arbitrary value, like you can with a cons? Is "" nil?"

Yes and yes. I plan for the only difference between strings and conses is that A) they have a type of 'string, in addition to a type of 'cons, and B) they display differently, surrounded by "" rather than ()

Generally speaking, strings will only contain characters (since that's what the string constructor does), but I don't see why they can't contain arbitrary stuff, if you want to do that.

P.S. I might not actually give them a type of string... in that case the only difference would be that they display differently. That might be an interesting approach.



1 point by rocketnia 4724 days ago | link

Okay, sounds fine to me. ^_^

-----

1 point by Pauan 4724 days ago | link

Actually, you probably didn't notice, but in Arubic/Python, strings literally are a subclass of cons, so they really do behave just like conses in almost every situation. I didn't make (is nil "") return t though. That shouldn't be hard to add, but I've been busy on Arubic/ar.

-----