Arc Forumnew | comments | leaders | submit | offby1's commentslogin
3 points by offby1 6250 days ago | link | parent | on: hosting for arc web app

Another happy linode customer

-----


a way to open a client socket

-----

1 point by offby1 6253 days ago | link | parent | on: Arc with vim

I'm pretty sure pg uses vi or vim, so it must be doable. Hang in there.

-----


Ooh, I like the sound of this.

-----


I guess I'm totally confused about "annotate", then; I thought that (= y (annotate 'fn z)) would return #3(tagged mac #<procedure: f>) -- i.e., it would _replace_ the existing annotation, rather than _adding_ to it.

-----

4 points by absz 6257 days ago | link

No; as nex3 observed, it's supposed to add it (cf. http://www.paulgraham.com/ilc03.html). Why? This is more general. Right now, we can define reptag to do what you want:

  (def reptag (typ obj)
    (annotate typ (rep obj)))
If we just had reptag, we couldn't define annotate.

Also, annotate obeys two useful identities:

  (type (annotate x y)) --> x
  (rep  (annotate x y)) --> y
However, reptag does not:

  def                      --> #3(tagged mac #<procedure>)
  (rep (annotate 'fn def)) --> #3(tagged mac #<procedure>)
  (rep (reptag   'fn def)) --> #<procedure>
Because of the type-replacing behaviour, that identity does not hold for tagged objects. I consider that a strike against it as well.

-----

2 points by almkglor 6256 days ago | link

Hmm. I suppose the real issue here is what pg intends to happen when annotating already tagged objects:

  (= y (annotate 'bar 'hmm))
  (annotate 'foo y)
3 options:

  ; option1: current Arc
  arc> (annotate 'foo y)
  #3(tagged foo #3(tagged bar hmm))
  arc> y
  #3(tagged bar hmm)
  ;option2: my proposal
  arc> (annotate 'foo y)
  #3(tagged foo hmm)
  arc> y
  #3(tagged foo hmm)
  ;option3: something else entirely
  arc> (annotate 'foo y)
  #3(tagged foo hmm)
  arc> y
  #3(tagged bar hmm)

-----

4 points by nex3 6256 days ago | link

I think it's pretty clear that he intends option 1, as that's how it actually works, and as absz pointed out, is a strict superset of the functionality of option 2 (and has nicer properties, too).

-----

4 points by offby1 6272 days ago | link | parent | on: New version

I do believe you're right; I think I fixed that in the ac.scm available at git://git.nex-3.com/arc-wiki.git

-----

2 points by offby1 6272 days ago | link | parent | on: Stupid noob question

I have a vague notion that arc would be a good teaching language ... I wonder if anyone else thinks so.

-----

4 points by kens 6272 days ago | link

I think the lack of good debugging support eliminates the current version of Arc as a teaching language. DrScheme is probably a reasonable choice; it's built on MzScheme. http://www.plt-scheme.org/software/drscheme/

-----

1 point by kennytilton 6272 days ago | link

Do either of those support CL-style defmacro?

-----

1 point by Jekyll 6272 days ago | link

Dr Scheme does. Fire it up, click language then choose language. Pick "pretty big", then (define-macro ...) will do pretty much what you expect. http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-...

-----

1 point by mec 6272 days ago | link

Side question here, is there a keybinding anywhere in DrScheme to close all open parentheses? It's driving me crazy trying to find it.

-----

1 point by danielprager 6271 days ago | link

Dunno, but the '[' and ']' keys in DrScheme are clever enough to give you '(' and ')' when you need them (and '[' and ']' at other times).

Since discovering this I just keep tapping ']' until the highlighting tells me I'm done.

-----

6 points by offby1 6273 days ago | link | parent | on: prn drops quotes on string?

why not just use "write"?

-----

1 point by kens 6273 days ago | link

Thanks; I didn't see "write".

A couple more problems:

  arc> (= x (thread (fn () nil)))
  #<thread>
  arc> (prn x)
  #<thread>Error: "Type: unknown type #<thread>"
  arc> (prn (exact 1))
  #tError: "Type: unknown type #t"
  
It looks like the Scheme types are leaking through, breaking things that use them, not just prn.

-----

1 point by kens 6273 days ago | link

One more output question:

  arc> (= x '`(a ,b ,@c))
  (quasiquote (a (unquote b) (unquote-splicing c)))
How can I print x in its original short form, rather than expanded out (as prn does)? Is there an easy function I'm missing, or do I need to write my own?

-----

1 point by offby1 6274 days ago | link | parent | on: Arc Indentation Syntax

this is The Meme That Will Not Die

-----


it seems to depend upon something named "enum", which I don't have defined.

-----

More