Arc Forumnew | comments | leaders | submitlogin
1 point by jgrahamc 6135 days ago | link | parent

Notes on the tutorial:

1. I have a hard time parsing the following:

"In Arc, data structures can be used wherever functions are, and they behave as functions from indices to whatever's stored there. So to get the first element of a string you say:"

I think there's something wrong with the word 'from'.

2. When you say:

"There's also a more general loop operator that's similar to the C for operator and tends to be rarely used in practice, and a simple repeat operator for doing something n times:"

I assume that the operator is actually called 'loop'. Since there's no example and no font distinction it's note clear.

3. I like this a lot:

"[... _ ...] is an abbreviation for (fn (_) (... _ ...))."

4. This feels backwards to me: "(foo:bar x y) is equivalent to (foo (bar x y))". I was expecting (bar (foo x y)), but perhaps that's just my brain. foo:bar reads to me like do foo then do bar.

5. Why have rem when you have keep and ~?

6. What's the rationalie for the name 'obj' when creating hashes?



1 point by oditogre 6134 days ago | link

Other notes as I'm reading along:

1. It would be nice if you could change it to html instead of txt so footnotes (and possibly references to other sections, if you're really ambitious) can be links so it's easier to skip around (using 'open in new tab') without losing your place. It would also be useful for fixing jgrahamc's 2nd issue.

2. I'm having a bit of trouble getting the do / when section (my only prior experience with lisp is scanning some PCL way back when reddit was young - I use lisp-in-a-box as a calculator a lot when playing Eve Online, but that's not really useful experience here). If I'm understanding it correctly, it seems accurate to say that (if a b) is valid and will return b when a is true and do nothing otherwise. Is that right?

I think what I'm getting hung up on is that you talk about 'if' with 3 arguments, then with more than 3 arguments, then you explain 'do', and then when you combine them back together it looks like you're using 'if' with 2 arguments, with the 'do' part being, in it's entirety, the second argument...but otherwise you never address a plain old 'if' with 2 arguments.

-----

3 points by pg 6134 days ago | link

Yes, (if (is 1 2) 'a) returns nil.

-----

1 point by oditogre 6134 days ago | link

Thanks. Just finished reading the tutorial and everything else seemed to mostly make sense (for the things not covered by that 'mostly', I suspect it's to do with the lack of descriptive names / real-world-application examples, which is fine; I'm sure it'll fall into place once I install it and actually start playing around a bit. :)

-----

1 point by etal 6133 days ago | link

I know a couple: 4. That's the "compose" operator. In math notation, the symbol looks like a small mid-line circle. 6. From the intro: "it uses overlays on hash tables instead of conventional objects". Python kind of does the same, where you can get an object's attributes as obj.__dict__.

-----

1 point by __ 6134 days ago | link

Regarding 1, I think a function "from X to Y" is a function that takes X as an argument and returns Y.

-----

1 point by jgrahamc 6134 days ago | link

Ah Yes. Thank you for that explanation.

-----