sjs


16 points by sjs over 2 years ago | link
cached 10 days ago

10 points by sjs over 2 years ago | link
cached 9 days ago

9 points by sjs over 2 years ago | link
cached 13 days ago

9 points by sjs over 2 years ago | link | parent | top
cached 1 day ago
Me neither, but I gave it a shot. I use it and it works, there may be bugs though. Maybe an Emacs guru will be kind enough to point out the errors I may have introduced while adapting cmuscheme.el.

http://samhuri.net/inferior-arc.el

In my dot-emacs:

  (setq arc-program-name "~/src/anarki/arc.sh")
  (load "~/.emacs.d/inferior-arc.el")
Then go ahead and do run-arc, arc-send-definition{,-and-go} (C-c C-e, C-c M-e) arc-send-region{,-and-go} (C-c C-r, C-c M-r), etc.

8 points by sjs over 2 years ago | link
cached 10 days ago

8 points by sjs over 2 years ago | link | parent | top
cached 6 days ago
I would prefer it if (cut "abcde" 1 -1) returned "bcd" rather than "bcde". Other than that I like the new cut.

7 points by sjs over 2 years ago | link
cached 7 days ago

6 points by sjs over 2 years ago | link | top
cached 13 days ago
How about this?

  (map [readb stream] (range 1 n))
It probably doesn't perform as well on big inputs.

5 points by sjs over 2 years ago | link | top
cached 13 days ago
Considering that (1 2 3) is just sugar for (1 . (2 . (3 . nil))) modern lisp programmers find many practical uses for dotted lists.

In this case the implementation and interface are so intertwined that it seems difficult (impossible?) to change one without significantly changing the other. As absz pointed out, car, cdr, cons would have to be rethought and redesigned or simply replaced.

If you get rid of cons/car/cdr I don't think you really have lisp anymore. That's not to say non-lisps are dumb or useless, but when you set out to create a better lisp you should at least create a lisp.

I think that a sequence abstraction, à la Clojure[1,2], is a nice idea though.

  [1] http://clojure.sourceforge.net/
  [2] http://clojure.blip.tv/file/707974/

5 points by sjs over 2 years ago | link | parent | top
cached 6 days ago
Indeed, and it does when you call compose directly. The good news is that if you name the string it works as expected.

  arc> (= s "abc")
  "abc"
  arc> (prn:s 1)
  b
  #\b
The reader splits expressions such as (prn:"foo":[idfn _] 2) into (prn: "foo" : (make-br-fn (idfn _) 2). You could check for trailing : in the car or a leading : in the cadr, and if found then wrap strings and tables in id fns. Stash them (as well as literal fns and make-br-fns) under a uniq name. Finally, add the uniq name to the end of the head symbol and repeat if necessary. This would be done before expand-ssyntax. I'm not sure it's worth the effort.

I think the final result would be very cool, mostly to allow things like (prn:[_ 3] "hello").