Arc Forumnew | comments | leaders | submit | nex3's commentslogin

I vote yea!

I think lists should support this as well, if strings and arrays do. Also, indexing from the back also comes in very handy:

  > ("foobar" -3)
  #\a
  > ("foobar" -4 -2)
  "oba"

-----

1 point by nex3 6662 days ago | link | parent | on: Arc mode for emacs?

I'll see if I can't hack something together using lisp- or scheme-mode with redefined keywords over the weekend. That is, unless someone beats me to it.

-----


Arc actually does support UTF-8.

  arc> ("uber" 0)
  #\u
I imagine it only officially supports ASCII because it will be migrated away from MzScheme eventually.

Note: Those "u"s are supposed to have umlauts, but that's apparently normalized away somewhere. The point is, u with an umlaut is treated as a single character by the current implementation.

-----

1 point by mascarenhas 6663 days ago | link

Well, indexing will most certainly break, but making an encoding agnostic reader/writer is easy, I hope PG does that when/if Arc goes standalone.

-----

1 point by nex3 6663 days ago | link

I'm sure it'll be agnostic, if by "agnostic" you mean that it just reads in strings as a sequence of bytes. It would be easier to do that than to check for non-ASCII characters and handle them specially.

-----

1 point by nex3 6663 days ago | link | parent | on: Arc as a better "common" Lisp?

I'm not sure PHP's really up to the task - lacking closures might prove to be a big issue. It would probably be reasonably simple to make an arc interpreter, or an interpreter for a simpler intermediate language, but performance would probably suffer.

-----

1 point by apotheon 6662 days ago | link

Why not write an Arc interpreter in Perl -- or even an interpreter for a web-centric subset of Arc? Stick the interpreter in the cgi-bin directory and use that to run your Arc scripts. Perl/CGI is even more ubiquitous on shared hosting accounts than PHP, supports closures, et cetera.

In fact, I've considered creating a new closures-based object system in Perl 5 in the past (never got around to it), which sounds suspiciously like it might have some things in common with some characteristics of Arc.

-----

2 points by pc 6663 days ago | link

The lack of closures just means the compiler has to do a little more work.

-----

7 points by nex3 6663 days ago | link | parent | on: Improve your arc REPL

My current bin/arc:

  #!/bin/sh
  cd ~/src/arc0 && rlwrap -C arc mzscheme -m -f as.scm
The -C option gets it to have different history for arc and mzscheme.

-----

2 points by babo 6662 days ago | link

  #!/bin/sh
  rlwrap -C arc mzscheme -m -e '(load/cd "~/src/arc0/as.scm")'

-----