Arc Forumnew | comments | leaders | submitlogin
Questions from a newcomer
2 points by Adlai 5650 days ago | 6 comments
I've been curious about trying Arc for a while, but have both been too busy, and using Windows. However, now that those problems are gone, I have an opportunity to look into it more closely, and I have two questions.

1) Why is Arc a Lisp-1, rather than a Lisp-2? I realize that this is a huge issue that's been up in the air since the beginnings of Lisp... but it seems to me as though a Lisp-2 gives much more flexibility than a Lisp-1.

It also doesn't seem to me as though a Lisp-2 requires that much "clutter" to the code. For one thing, a better name for a function like apply or funcall could be "use". Also, section 5, "Syntax", of http://paulgraham.com/arcll1.html, suggests to me that the clutter of a Lisp-2 (funcall, apply, symbol-function, etc) could be greatly abbreviated by using some syntax. For example, instead of:

   (function fn)

   (apply fn args)
you could have:

   $'fn

   ($fn args)
There's no special significance to choosing the $ (sigil) here, except that I don't think it currently has any significance in Arc.

Although I'm anything but a Lisp expert, it does seem to me that it should be possible for a "word" to have meaning both as a "noun" and a "verb".

2) Since I'm completely new to Arc, should I check out the previous release (arc2.tar) before I look at the new one from a few days ago? There seems to be, at the moment, a lot of "documentation" (such as http://arcfn.com/doc/index.html) on the previous version, which could help a newbie.

Thanks, Adlai

EDIT -- fixed formatting problem



3 points by rntz 5649 days ago | link

The lisp-1 versus lisp-2 issue is an old one, as you note. I prefer lisp-1's, because they are conceptually cleaner - they don't make an arbitrary distinction between where to find values of a certain kind (functions) and where to find values of another kind (everything else). It reduces cognitive load not to have to think about "okay, is this going to be found in the function namespace or in the other-values namespace?".

More practically, as I tend towards a functional programming style, it's also a boon to me not to have to type #' or $' (or some other special syntax) whenever I want to use a function somewhere other than functional position. This may seem like a small issue, but arc itself is a fairly functional language; many of its core functions (eg: map, keep, rem, trues, zap, check, only, pos, find, sort, ...) are higher-order, so such a prefix would have noticeable cost in terms of characters typed.

-----

2 points by CatDancer 5650 days ago | link

1) How would using a separate namespace for functions give a lot more flexibility?

2) Yes, starting with arc2 is fine; especially if you're going through the Arc tutorial.

-----

1 point by Adlai 5650 days ago | link

Having separate meaning, determined by context, means that you don't have to use as many distinct identifiers in your program. This is especially pronounced if you're trying to use short identifiers, because there are fewer short identifiers that have some intuitive meaning attached to them, and I think it's useful to allow context to alter this meaning.

However, now that I think of it a bit more, making Arc a Lisp-2 would interfere with using compound data in the place of functions. If you have a symbol whose value is a compound type, and that symbol also has a function value, that creates an ambiguous situation. I'll have to suspend my opinions about Lisp-n-ness until I've used Arc for a while.

-----

2 points by pg 5649 days ago | link

Having separate meaning, determined by context, means that you don't have to use as many distinct identifiers in your program.

That would make your code very confusing. Even in Lisp 2s, programmers avoid using the same names for functions and ordinary variables.

Arc3 is getting stable enough that you can probably start with that. Most basic stuff (e.g. everything in the tutorial) should be the same anyway.

-----

7 points by zbeane 5649 days ago | link

> Even in Lisp 2s, programmers avoid using the same names for functions and ordinary variables.

No, they don't.

-----

1 point by Adlai 5647 days ago | link

I'm a big fan of using identifiers such as 'list, 'string, 'fn (isn't a problem in CL, but is one in Arc), 'array, 'char, etc. Often a general name is the most concise and appropriate name to use.

I think that since Arc is supposed to be designed towards flexibility and usability for the programmer, it should have few restrictions, and a common namespace is such a restriction.

However, my opinion on this could change as I explore Arc over the next few weeks.

-----