Arc Forumnew | comments | leaders | submit | Amferreira's commentslogin

You are right, I had forgot about (= (car y) (list 1 2)).

-----


Yes, but then you can't print hash tables in a way that is also readable, and unambiguous with a list. Right now: arc> (= codes (obj "Boston" 'bos "San Francisco" 'sfo "Paris" 'cdg)) #hash(("Boston" . bos) ("Paris" . cdg) ("San Francisco" . sfo))

Could be: arc> (= codes {("Boston" 'bos) ("San Francisco" 'sfo) ("Paris" 'cdg)} {("Boston" 'bos) ("San Francisco" 'sfo) ("Paris" 'cdg)}

If the () are required or not is up for discussion, keys/values could be positional like obj.

Note that printing (obj a 1 b 2) as (obj a 1 b 2) is ambiguous with printing the list '(obj a 1 b 2)

-----

2 points by drcode 5893 days ago | link

I think you have a good point here. I'll have to think about this line of thinking some more.

-----

1 point by Amferreira 5897 days ago | link | parent | on: Explicit local =

Well, I'm kinda ashamed, but I just found out that define in scheme does just that. If you define a variable inside a block, the variable belongs to that block. Does def in arc work like that also? (I don't have arc in this computer, so I can't test it)

-----

2 points by stefano 5896 days ago | link

I think internal 'define in scheme must occur at the beginning of a function definition, not intermixed wth other expressions.

-----

2 points by almkglor 5897 days ago | link

No, it doesn't

-----