Arc Forumnew | comments | leaders | submit | ehird's commentslogin
1 point by ehird 6168 days ago | link | parent | on: Unquoting

blaise did this too

-----

1 point by ehird 6168 days ago | link | parent | on: Unquoting

'',x

-----

1 point by sjs 6168 days ago | link

But ``,x is certainly not the same as `',x

Here's a macro for illustration:

     (mac a (x y)
      `(do (prn ',x)
           (prn `,y)))
Compared with:

    (mac b (x y)
      `(do (prn ',x)
           (prn `,,y)))

    arc> (a 1 2)
    1
    Error: "reference to undefined identifier: _y"
    arc> (b 1 2)
    1
    2
    2

-----

1 point by ehird 6168 days ago | link | parent | on: Implementation of ac.scm for SBCL

which ofc means the web lib won't work

-----

1 point by ehird 6169 days ago | link | parent | on: Show us your Arc code

Ridiculous:

    (def ablast (l)
      (if (no (cdr l))
          nil
          (cons (car l) (ablast (cdr l)))))

    (def replc (x y l)
      (if (atom l) (if (is x l) y l)
          (no l) nil
          (is x (car l)) (cons y (replc x y (cdr l)))
          (acons (car l)) (cons (replc x y (car l)) (replc x y (cdr l)))
          (cons (car l) (replc x y (cdr l)))))

    (mac imp body
      (if (no body) nil
          (replc 'it `(imp ,@(ablast body)) (last body))))

-----

2 points by ehird 6169 days ago | link | parent | on: Unifying characters, strings AND symbols?

wrong

smalltalk "abc"= comment

-----

2 points by ehird 6169 days ago | link | parent | on: Purely functional programming with Arc?

it is impossible. it is the halting problem. sorry.

(Well, monads without unsafePerformIO would work..)

-----


thingy

  (mac defx (n x . b)
    (if (no b)
        `(= ,n ,x)
        `(def ,n ,x ,@b)))

-----

1 point by ehird 6169 days ago | link

silly:

  (defx accgen [let x _ [++ x _]])

-----

1 point by drcode 6169 days ago | link

I can tell I didn't communicate the intended purpose very well... let me put up another post that isn't as half-assed as my first one was (tonight)

-----

1 point by ehird 6169 days ago | link | parent | on: Clarification about Character Sets

it was a parody, to show that in a few days we could do what took 6 years.

-----

1 point by ehird 6171 days ago | link | parent | on: Arc, a Comedy of Errors: Part I

Does that make a difference? For a start, if () evaluates to anything it should evaluate to itself (I don't think we have any disagreement here), and 'x should certainly be x. Now, this implies that when you put a quote before (), it's read in as a different object. This is obviously nonsense: it's the Arc evaluator's `quote' that does this, as a way to work around the underlying Scheme. But missing that () by itself would evaluate to the underlying Scheme's () is just shoddy.

Paul Graham, you had years to do this. Why did you have to make something so incomplete and hacky? I didn't even expect Jesus, like most people - I thought it would be nothing too great. But this is just ridiculous.

-----

5 points by pg 6171 days ago | link

This is a trivial sort of ridiculous, though. Nil and the empty list are logically undistinguishable.

The reason I made something so incomplete in superficial respects like this is that I focused instead on things that mattered. Particularly, making programs shorter-- which I deliberately phrase in that low-key way, but which is in fact pretty near identical with what programming languages are for. In that respect Arc seems from my experience to be significantly better than CL or Scheme.

-----

1 point by kennytilton 6171 days ago | link

The funny thing is that just as you did this with Arc I have been trying to push somethinganything out the door on my own product (it too is pretty far along, it too has a ways to go) just to motivate me with user feedback. Seriously reconsidering...

-----

1 point by ehird 6171 days ago | link

I think your focus entirely on shortness is a bit misguided. If that's your goal, you should give up and just use Perl or similar. But of course that isn't you're entire goal, so you're being (unintentionally) misleading. I'm sure a goal isn't inconsistency like this.

-----

7 points by pg 6171 days ago | link

Perl programs for doing common things to strings are short in characters. They're not so short in tokens. But more importantly, Perl doesn't have the kind of brevity you can get from having macros.

-----