Arc Forumnew | comments | leaders | submit | ambition's commentslogin
1 point by ambition 5750 days ago | link | parent | on: HN: (hacked & fixed)

When investigating for hnacademic.com I came to the same conclusion you did.

Here's the modified code I used on hnacademic.com:

                         (let (typ id val view mod) it
It works, at least for the published crack.

-----

1 point by ambition 5974 days ago | link | parent | on: Mutual recursive lambdas in a with?

Oh, I see. I didn't do the 'f2 nil' line when trying withs so I got errors when f1 couldn't find f2. Also I didn't know you could do that with let!

Great help, thanks.

-----

1 point by ambition 5977 days ago | link | parent | on: Editing Arc in TextMate...?

See also http://arclanguage.org/item?id=7784

-----

2 points by ambition 5977 days ago | link | parent | on: A textmate bundle for Arc

Git URL: git://github.com/aran/arc.tmbundle.git

It's based on the Scheme bundle, with updated function highlighting plus some snippets for common things typed.

-----

2 points by ambition 5971 days ago | link

It now supports rudimentary folding and Function Pop-up (Shift-Command-T) navigation.

-----

2 points by ambition 5971 days ago | link

Another update: I contacted Allan Odgaard to ask about putting in a feature that would allow folding to work nicely. There probably won't be a fix. The workaround that I'm using is this:

    (def foo (...) 
        ...))
    ); unusual - last closing parens of a block on next line
This allows very simple root-level folding.

-----


I looked into this some more, and it looks like this is a difference between arc and scheme. I just wanted to put this out there for anyone else looking at Scheme materials through an Arc lens.

Arc:

    arc> (def fn2() (def i() (prn "fn2-i")) (i))
    #<procedure: fn2>
    arc> (fn2)
    fn2-i
    "fn2-i"
    arc> (def fn1() (def i() (prn-"fn1-i")) (fn2) (i))
    #<procedure: fn1>
    arc> (fn1)
    *** redefining i
    *** redefining i
    fn2-i
    fn2-i
    "fn2-i"
    
Scheme:

    > (define (fn2) (define (i) (print "fn2-i")) (i))
    > (fn2)
       "fn2-i"> (define (fn1) (define (i) (print "fn1-i")) (fn2) (i)) 
    > (fn1)
       "fn2-i""fn1-i">

-----


Thanks!

-----


For completeness (and in case someone can spot my mistake!) here's the broken Y Combinator version:

    (def Y2 (m) ((fn (f) (m (fn (a result) (f f) a result)))
          		(fn (f)	(m (fn (a result) (f f) a result)))))
    ; broken
    (def accumulate (combiner null-value term a next b)
    	((Y2 (fn (r)
    			(fn (a result)
    		   		(if (> a b) result
    		       		(r (next a) (combiner (term a) result))))))
    		a 
    		null-value))

-----

7 points by ambition 6154 days ago | link | parent | on: Anarki Conventions

As a principle to consider, how about: "Any change to anarki should not break any program which runs correctly on the latest arcn, if the program does not exploit bugs in arcn."

What do you think?

-----

3 points by almkglor 6152 days ago | link

You know, any change to anarki which adds macros, of all things, would break some programs that run correctly on the latest arcn.

For example, suppose I were to define a simple macro, nothing:

  (mac nothing () nil)
Then the following simple program will run correctly on arc1, but fail if you define the above macro:

  (def doda (xs)
    (let nothing (table)
       (each x xs (assert (nothing x)))
       nothing ))
I think the above issue definitely needs to get fixed.

-----

2 points by raymyers 6151 days ago | link

True. Anarki-only macros should probably be banished to the `lib' folder, so they have to be (require)'d before they start modify your code.

-----

2 points by nex3 6151 days ago | link

I'm not so sure about this. I think changes of the filling-up-namespace sort are reasonable, for the same reason being a Lisp-1 is reasonable: conflicts happen rarely in practice.

A better solution would be to try to ensure that only generally useful macros are added to arc.arc, and that they have names that are unlikely to be used as local variables. Or even better would be to make local variables shadow macros.

Consider this, though: "help" is defined as a macro. Some of the REPL-var code needs macros. The drop-into-scheme operator is a macro. I don't think we want to make people load a library file to use these.

I see the compatibility rule as more of a guideline - try not to break the functionality of stuff that already exists. But I don't think it should limit experimentation and exploration, including exploration of what's useful to have in arc.arc.

-----

2 points by raymyers 6151 days ago | link

OK, I'll backpedal a bit here. The last thing I want is to have to require "lib/help.arc" :). It should be easy to find out what macros have been added though -- as much for curiosity as for compatibility. I'll try and whip up a script tonight, unless someone beats me to it.

-----

4 points by raymyers 6151 days ago | link

Script complete. It crawls `arc.arc' and every file loaded by `libs.arc'. So now, if you type the following,

    (require "lib/new-macros.arc")
    (new-macros)
... you will discover that the non-Arc1 macros in Anarki are currently:

    ($ % % %% %%% breakable defsop help make-br-fn or= redef)

-----

1 point by nex3 6151 days ago | link

Most excellent. It's great to see how easy it is to analyze Arc code using Arc.

Anyway, of those, the only one I see potentially conflicting with a variable name is "breakable", and that seems quite unlikely.

-----

2 points by akkartik 6151 days ago | link

Great thread to see how y'all converged on a design decision after some back and forth.

-----

4 points by raymyers 6153 days ago | link

That's a great requirement, but it might easier to obey if there was a test suite.

-----

4 points by nex3 6153 days ago | link

Please, feel free to make one (or rather, contribute... offby1 has the beginnings there already).

-----

3 points by nex3 6153 days ago | link

I agree. I've pushed something to that effect.

-----

2 points by byronsalty 6153 days ago | link

Ok. The public_html change I made to srv last week will break anyone expecting to serve files out of the root directory (as they would with arc1). Should I revert this change? Then plead PG to pick it up with arc2...

Actually I could default the docroot to "" instead of "arc/public_html". I think it's ugly but if we want to be compatible with arc1 then this would do it.

-----

3 points by nex3 6153 days ago | link

I think this isn't so much a language issue as a configuration issue, so it should be fine.

-----

2 points by raymyers 6152 days ago | link

If anyone notices an issue regarding Anarki's compatibility with Arc, please note it in BUGS. Thanks :)

-----

3 points by ambition 6166 days ago | link | parent | on: Arc Repo

I put a note in the subversion repository to this effect --- unless there are any complaints, I'm going to take the code out of the SVN repository and leave only a note. There's no point in spending any time merging back and forth.

For now, anyone who is interested in Arc is smart enough to figure out git.

-----

4 points by ambition 6169 days ago | link | parent | on: This is probably a really bad idea.

Done!

http://arclanguage.org/item?id=966 http://ambitioushacker.com/s/arc/README

-----

More