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

Have you tried using that? It's in arc2 already.

-----

1 point by tokipin 6077 days ago | link

wow lol. same name and everything. i guess it's not such an uncommon concept. i think i got the idea from anaphoric macros

thanks for pointing it out

[edit]it looks like there is only one global 'that, so it is unusable in functions. it seems more of a REPL mechanism at the moment. i guess to implement it in the spec would require wrapping things in (let that ...), or having it in the core

-----

1 point by sjs 6101 days ago | link | parent | on: Regular expressions

This SRE (Scheme Reg. Ex.) proposal looks interesting. It's dated '98 and I didn't find any info about an implementation so perhaps it's not interesting in practice, or maybe no one has just done it yet. It's a superset of regular expressions with an s-expr syntax that allows for neat things, such as (- alpha ("aeiouAEIOU")) to match vowels.

http://www.scsh.net/docu/post/sre.html

[Unfortunately I can't get to the site right now but the link worked recently so hopefully scsh.net is just down temporarily.]

-----

1 point by nex3 6101 days ago | link

Yeah, I saw that, too. I agree it looks cool, but I'm a little skeptical because it's so much less concise than standard regular expressions. Maybe this is really a good thing, I dunno.

-----

1 point by beyert 6072 days ago | link

The scsh sres really are wonderful, much easier to use than regular regular expressions, (especially compared to xemacs which I constantly make mistakes with) and you don't have to deal with complex string quoting to use them.

If I were Paul, I would design a similar API for regular expressions.

-----

2 points by sjs 6103 days ago | link | parent | on: How to implement a no-side-effects macro?

This might be crazy, but how about changing ac-global-name (ac.scm) to a unique gensymed prefix? I don't know about doing it per thread, but it could be an interesting way to temporarily create a unique namespace.

edit: To be clear, I mean exposing it in arc somehow so you can effectively (let global-name (uniq) ...).

-----

1 point by lacker 6101 days ago | link

Interesting, I hadn't thought of this. You have to somehow let people still refer to, say, the + function, by its global name. Maybe that could be via some sort of const wrapper thing.

-----

1 point by sjs 6103 days ago | link | parent | on: HTTP header case bug

You probably need a newer git. People recommend using git HEAD and I haven't had problems with it so far.

  cd ~/src
  git clone git://git.kernel.org/pub/scm/git/git.git
  cd git
  make prefix=$HOME/apps all doc info
  make prefix=$HOME/apps install install-doc install-info

-----

1 point by sjs 6103 days ago | link | parent | on: HTTP header case bug

NB: I am a total git noob and you shouldn't listen to anything I say.

When I pull I do `git pull --rebase' which avoids the merge commits. I'm not sure what the interactive (-i) switch to git rebase does (I have a good idea though), but the default place to pull from is origin/master (afaik) so they're probably quite similar.

-----

1 point by tung 6103 days ago | link

Thanks. The merge log messages are technically accurate, but they seem like the sort of thing that would clutter the history.

-----

4 points by sjs 6103 days ago | link | parent | on: Arc has no return statement?

Arc doesn't use ccc for web apps, just good old closures.

-----

7 points by almkglor 6103 days ago | link

Actually, the form of closure used by Arc is highly similar to a continuation passing style, so although it doesn't use 'ccc, it does use continuations.

-----

5 points by sjs 6105 days ago | link | parent | on: Dotted lists - HUH! What are they good for?

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/

-----

6 points by sjs 6106 days ago | link | parent | on: Can you help with shortening this code?

How about this?

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

-----

3 points by CatDancer 6106 days ago | link

I like that better than my code. ^_^

As for performance... hard to say, I think. My version conses up a big list and then reverses it, your version conses up a big list and then maps it. So without some actual testing or analysis...

-----

2 points by sjs 6106 days ago | link | parent | on: Poll: What do you edit Arc code with ?

Visor sounds interesting. What sort of interaction is there between TM & the REPL? Do you have commands like "send defun to repl" and "send file to repl"?

-----

2 points by absz 6106 days ago | link

No, just (load "~/Arc/deriv.arc") in the REPL (which suffices). I imagine I could hook something up with AppleScript... hmm, having problems accessing the tabs of the sliding window. If I could, then "send file to REPL" would be

  on loadFile(fileName)
    tell application "Visor Terminal" to ¬
      do script "(load \" & POSIX path to fileName & "\") ¬
      in current tab of window id -1
  end sub
, assuming that the REPL was in the active tab. Well, if I can get that to work, I'll tell you.

Visor was written by the guy who wrote Quicksilver, and is similarly excellent. It's a bit tricky to get working on Leopard, but it's worth it.

-----

3 points by sjs 6106 days ago | link

I'm pretty stuck on Emacs for Lisp stuff, but interfacing with a REPL from TM would be a step closer for me to give it a shot. Understanding s-exps is next on the list.

I'll have to read more on Visor (or just try it). It doesn't look too interesting at a glance since iTerm is already a Cmb-tab away. There must be more to it that I'm missing.

-----

2 points by absz 6106 days ago | link

I prefer Visor for a few reasons. First, I just prefer Terminal to iTerm (especially now that it has tabs). Second, F3 (my hotkey) always gets me Visor; cmd-tab may take more or less key presses depending on what apps I've been using. Third, since I set Visor up to use a different Terminal which runs in the background, so that's one less app to cmd-tab past. Mostly, it's a convenience thing-one F3, and always one F3.

-----

1 point by sjs 6109 days ago | link | parent | on: Macros: Arc internals part 2

This is great kens. Thanks for all the docs.

[nitpick] In the 3rd last paragraph this part isn't really clear:

  "Except for macex1, ac-macex is then called recursively..."
              ^^^^^^
The first time I read it I thought you meant that ac-macex was called recursively for macex1, which is obviously not what you mean.

-----

2 points by kens 6109 days ago | link

I appreciate the nitpick; I've changed the text to be clearer. (In general, I welcome feedback on how to improve the docs, especially if I'm blatantly wrong about anything.)

-----

More