Arc Forumnew | comments | leaders | submitlogin
Errors in anarki stable
2 points by Oscar-Belletti 3029 days ago | 12 comments
I followed the arclanguage.github.io instructions, and tried to mutate a string as in the tutorial:

    $ git clone http://github.com/arclanguage/anarki
    $ cd anarki
    $ git checkout stable
    $ ./arc.sh
    main: not defined or required into the top-level environment
    ./arc.sh: line 40: [: too many arguments
    Use (quit) or ^D to quit, (tl) to return here after an interrupt.
    arc> (= s "foo")
    "foo"
    arc> (= (s 0) #\m)
    Error: "string-set!: contract violation\n  expected: (and/c string? (not/c immutable?))\n  given: \"foo\"\n  argument position: 1st\n  other arguments...:\n   0\n   #\\m"
    arc> s
    "foo"
    arc>

Edit: I'm using racket v6.6, on Arch linux 64-bit


4 points by malisper 3026 days ago | link

That looks like [this](http://arclanguage.org/item?id=17699) which should have been fixed back then.

-----

3 points by akkartik 3026 days ago | link

Many thanks! I'll merge it to stable.

Edit: Done.

-----

2 points by Oscar-Belletti 3022 days ago | link

I checked now, string mutation works.

But what about the other warnings? Is the "main: not defined" warning due to my racket version?

The second warning (./arc.sh: line 40: [: too many arguments) disappears if I change (in arc.sh):

    if [ $repl = '#t' ]
To:

    if [ "$repl" = '#t' ]

-----

2 points by akkartik 3022 days ago | link

Yes, I wondered what to do about that and who if anyone cared about all those features. Then I forgot :/ I'll create a more bare-bones but working script today.

Edit 14 minutes later: Done: https://github.com/arclanguage/anarki/commit/8764126812. Do let us know if you have any other problems. (I've only tested the script on Mac at the moment.)

-----

2 points by Oscar-Belletti 3022 days ago | link

Now from the command line I don't get any warnings.

However, running arc in emacs (I use arc.el and arc-inferior.el) gives an error:

    rlwrap: error: My terminal reports width=0 (is it emacs?)  I can't handle this, sorry!
rlwrap doesn't work in emacs and this IMO is the reason the previous script had the --no-rl option.

-----

2 points by akkartik 3021 days ago | link

Ah, I see. Ok, I'll bring that back.

Thanks for explaining the reason for that flag.

Edit 15 minutes later: I've made the flag to disable rlwrap '-n' like in the master branch.

(I didn't pick the original flag, so I'm not attached to that name. I can change it if you want, I just want both branches to be consistent. I also renamed the script to 'arc' like in the master branch, just to make my life easier. I'll update the instructions at https://arclanguage.github.io next.)

-----

2 points by Oscar-Belletti 3021 days ago | link

Now it works both from the command line and from emacs.

It's ok for me that the the flag is -n.

I think that the arc script was named "arc.sh" because the folder which is used by the news server is "arc", and it would conflict. We can either take back the "arc.sh" name or change the news server's directory to something else, perhaps "www" like in the master branch.

Edit: We should also change the flag of the default program name in inferior-arc.el (line 95):

    (defvar arc-program-name "arc --no-rl"
To:

    (defvar arc-program-name "arc -n"

-----

2 points by akkartik 3021 days ago | link

Thanks for those comments!

Yeah you're right. I'm going to switch to arc.sh everywhere.

Edit 15 minutes later: all done, though the commit histories are a mess. Let me know if I missed renaming the script in any places!

-----

2 points by Oscar-Belletti 3019 days ago | link

"Thanks for those comments!"

You're welcome.

I'll certainly tell you if I find some references to the old "arc" name.

-----

2 points by akkartik 3028 days ago | link

Gosh, I haven't looked at 'stable' in ages and it looks like it's mostly unmodified since 2009, before the Racket days. It's still using 'mzscheme', which isn't even in my Racket 6.3 distribution on Mac OS anymore. And I no longer remember where we hacked Racket to permit mutable strings :/ I didn't see any diffs in ac.scm that might be responsible. Maybe someone else knows?

-----

2 points by zck 3027 days ago | link

Hrm, perhaps it shouldn't be called "stable". That suggests a more-tested release cycle. Maybe something like "original" or "pure", or even "3.1-release"?

I like the idea of having something that's what was originally released, but doesn't really suggest that it's what someone should use if they're new to Arc.

-----

4 points by akkartik 3027 days ago | link

Well, we do also have 'official' which is exactly what was released.

I think the intent is that 'stable' is guaranteed to be backwards compatible with 'official'. So the real issue is that 'official' is stale.

-----