What are the core features that differentiate Arc from other lisp dialects?
To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)
Anarki – Community-managed fork of the Arc dialect of Lisp
11–20 of 45 posts
Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#12Earlier quoted context omitted.
It would be more correct to say that they can be coerced to a function with a special purposes (e.g. using a set as a function is an alias for checking whether an item exists). To say they are functions would be incorrect. By the same logic, a keyword is would be a function.
They're callable as functions, i.e. they implement clojure.lang.IFn. So unless you want to shave hairs on what it means to say they're not "functions", they _are_ functions. Sets, vecs, maps, keywords, and IIRC symbols are all IFn Oh and (#{1 2} 3) is equivalent to (get #{1 2} 3) not (contains? #{1 2} 3)
So point taken.
Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#13Am I understanding right that Arc is a Lisp-1, like Clojure?
Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#14What are the core features that differentiate Arc from other lisp dialects?
To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)
arc> (map l '(0 1 2))
(1 2 3)
What is the logic here? Is l made into a function that holds state and returns each element in turn (like an iterator function)? Because I would've expected: arc> (map l '(0 1 2))
((1 2 3) (1 2 3) (1 2 3))
In what way is map being applied here?Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#15Am I understanding right that Arc is a Lisp-1, like Clojure?
Yes, or like Scheme.
(I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).
Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#16Earlier quoted context omitted.
To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)
I don't know Arc, so this confuses me: arc> (map l '(0 1 2)) (1 2 3) What is the logic here? Is l made into a function that holds state and returns each element in turn (like an iterator function)? Because I would've expected: arc> (map l '(0 1 2)) ((1 2 3) (1 2 3) (1 2 3)) In what way is map being applied here?
> In Arc, data structures can be used wherever functions are, and they behave as functions from indices to whatever's stored there.
(quoted from the Arc tutorial)
So
arc> (l 0)
1
and so on. So the GP makes sense.Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#17Earlier quoted context omitted.
Yes, or like Scheme.
I don't really get why you'd ever want a Lisp-2. Is there an argument/explanation somewhere that I could read up on? (I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).
(your-macro
(let ((x (foo y))
(bar x))))
I probably don't want the meaning of FOO or BAR to be up for grabs based on the expansion of YOUR-MACRO, and certainly not LET. Lisp-1s often have hygienic macros to deal with this concern, but not always.Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#18Earlier quoted context omitted.
To me, one of the most fundamental features of Arc is taking the unification of code and data much further. I don't know of other Lisps that do this! K is another language that does. arc> (= l '(1 2 3)) (1 2 3) arc> (= f [+ _ 1]) # arc> (map l '(0 1 2)) (1 2 3) arc> (map f '(0 1 2)) (1 2 3)
I don't know Arc, so this confuses me: arc> (map l '(0 1 2)) (1 2 3) What is the logic here? Is l made into a function that holds state and returns each element in turn (like an iterator function)? Because I would've expected: arc> (map l '(0 1 2)) ((1 2 3) (1 2 3) (1 2 3)) In what way is map being applied here?
Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#19Earlier quoted context omitted.
Yes, or like Scheme.
I don't really get why you'd ever want a Lisp-2. Is there an argument/explanation somewhere that I could read up on? (I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).
Re: Anarki – Community-managed fork of the Arc dialect of Lisp
#20Earlier quoted context omitted.
Yes, or like Scheme.
I don't really get why you'd ever want a Lisp-2. Is there an argument/explanation somewhere that I could read up on? (I've used Clojure and JS, which also seems like a "Lisp"-1 in that you can just put fns into variables and call them like 1st class fns, I just don't get why the distinction is in any way positive rather than confusing, and in Lisp-2s you now need to dereference everything all the time, like in Ruby).
The advantage of a Lisp-2 is that it makes macro writing easier; you can include calls to known functions in the expansion without having to deal with the possibility that those names have been shadowed.