The way . works in parameters is that it is a list of the rest of the parameters that you are passing to the function/macro. This list could be empty/nil or contain one or more elements.
arc> (mac meta (x . y) (prn x y))
1(2)
1
arc> (meta 1)
1()
1
arc> (is nil '())
t
Don't forget that nil and the empty list are equivalent in arc.
The language is compiled to virtual machine code similar to
what the listing shows, and is closer to the functional
programming camp than to perl (ultra fp geeky features for
defining your own fixed point combinators in section 7.5.3).
I got arc2 to work on linux and windows initially through searching the forums and finding bugs. It was an interesting exercise but overall I'd recommend arkani. arkani has more bug fixes and all sorts of interesting code to look at and/or use.
The learning curve is small if you have a math or cs education, if you've been exposed to another functional language or you naturally think in s-expressions.
If you are just a random python programmer and you looked at arc I could see it being challenging. The axioms of lambda calculus and functional programming are concise and simple but that doesn't mean the concepts they imply are also simple.
I agree The Little Schemer is a great book. Along with SICP, On Lisp, etc.
In the end it is worth the trouble to learn at least one lisp dialect. It'll improve your coding and make you question why you are writing imperative-language-001 all day long.
I ran into problems when I first started writing scheme. I think the learning curve seems steep because it is a different paradigm than python. Lisps are all functional languages. Most commonly used languages in the end are similar, they are imperative languages.
I'd expect it to take some time to get used to and learn this new style of coding. Variables in general are not needed especially outside the scope of a function or macro. Syntax is weird because there isn't much of it to begin with.
I'd recommend that you first read the entire tutorial and make sure you understand what's going on there. Then I'd recommend reading some of Paul Graham's "On Lisp". Even though it is in CL instead of arc - I think the philosophy is the same.
If templates isn't feature rich enough, I imagine it is just a matter of time before someone implements a more complete OO system in arc.
In the meantime there are a bunch of schemes and lisps that support different object systems. You'll want to look for CLOS (Common Lisp Object System) and MOP (metaobject protocol) in the descriptions. I've used gauche scheme and had some good luck. http://practical-scheme.net/gauche/
I think a macro solves the problem where (is 0 0.0) returns nil. I think the reason they are not equal has something to do with precision and the representation of 0 versus 0.0.
;allows equivalent ints to be equal.
;i.e 0 = 0.0, 1 = 1.000000, etc.
(mac == (a b)
`(if (and (is (type ,a) 'int)
(is (type ,b) 'int))
(is (+ ,a 0.0) (+ ,b 0.0))
(is ,a ,b)))
produces
arc> (== 0 0.0)
t
arc> (== 123 123.00)
t
arc> (== "a" "a")
t
arc> (== "a" "b")
nil
arc> (== 1 9)
nil
arc> (== 1 1.00000001)
nil
Interesting quirk. Glad I know that (is a b) may not always work.
I have wondered a few times why arc doesn't have keyword parameters. It is one of my favorite features in Gauche scheme. Other great features are clos like object system, module system and a thread system that supports preemption which is hard to find in scheme implementations.
In addition, I think keywords would make the library far more transparent. Right now I still have to root around and figure out what the heck I'm supposed to pass in.