Arc Forumnew | comments | leaders | submitlogin
Score one for Arc
9 points by kennytilton 6096 days ago | 8 comments
Just got this weird compilation error back working on my (CL) triple-cells implementation, on this code:

  (let q !ccc:ufb-reset-ephemerals
    (index-new-triples)...etc
    
:)


5 points by Zak 6096 days ago | link

A couple years ago, I saw a description of Arc's let syntax and immediately thought it was the Right Thing. I added an implementation to my util.lisp file that goes in to just about everything I write:

    (defmacro let1 (var val &body body)
      `(let ((,var ,val))
        ,@body))
I use it far more than CL's let.

-----

4 points by cchooper 6096 days ago | link

Forgetting where the parentheses go in let was one of the most common problems I had learning Lisp (and don't even mention cond).

It took me about 5 minutes to get used to the Arc syntax :)

-----

1 point by parenthesis 6096 days ago | link

What is the ! in !ccc:ufb ... supposed to be doing? Do you mean ~ccc:ufb-reset-ephemerals , i.e. (not ... ) ?

-----

1 point by kennytilton 6096 days ago | link

Sorry, I realized that would confuse things terribly only after posting, and would have edited it into a simple (let x 42..) after the fact to highlight the actual gaffe but decided it would be useful to share what is only coincidentally similar to Arcese in the syntax but identical in spirit.

What was posted was real CL code, but it leverages a sophisticated mechanism known as a reader macro. I imagine there might be similar hijinx in ac.scm supporting the Arc syntax, dunno.

!ccc:ufb-reset-ephemerals -> "<triplecells#ufb-reset-ephemerals>"

I do not have to type that particular RDF URI very often (done, actually, after three times) so I do not abbreviate (except for the UFB (but let's not digress))).

For the same reason that pg is creating Arc, CL programmers like to take stuff that will be a pain to to type and effectively automate the typing with a reader macro.

The use of the colon to separate the RDF namespace from the specific label is a nice pun the CL usage for its namespace mechanism packages. I got a little inconsistent in my hackery and nicknamed the triple-cells CL package "3C", so if I had to reference the stmt-new function in a different package not using triple-cells I would say (3c:stmt-new...).

-----

3 points by cooldude127 6096 days ago | link

this is cl code, not arc. that's the joke: he was using an arc style let in common lisp code.

-----

3 points by kennytilton 6096 days ago | link

Right, and the "score one" headline is about my concern that Arc abbreviations might not become second nature. My Arccells code uses a lot of it, but most times I had to go back and edit a (foo bar) into foo.bar cuz the (foo bar) just rolled off my fingers. Of course Arc and I are new to each other so it is too soon to tell, but it feels like my fingers now need a lookahead ability they may not be able to grow. I am especially suspect of the piping : ever catching on.

In this case, I guess the one variable LET syntax of Arc caught on pretty damn fast. :)

-----

2 points by bogomipz 6095 days ago | link

I'm sure you will remember to use foo:bar when the alternative is (fn args (foo (apply bar args)))

Using : only in the most important places might be a good thing. I.e not overuse it for (foo (bar x)) -> (foo:bar x) where it trades readability for 2 characters.

-----

1 point by cooldude127 6096 days ago | link

why doesn't that work, it's all parentheses? :D

-----