Arc Forumnew | comments | leaders | submit | pg's commentslogin
5 points by pg 5808 days ago | link | parent | on: Update: clearer +, inverse trig functions

Simplicity. I had to keep thinking about when I could use + and when string. But it might improve performance; I haven't checked.

-----

1 point by pg 5810 days ago | link | parent | on: Pedantic note on recstring

Oops, yes, will fix.

-----

1 point by pg 5810 days ago | link

This is fixed in the latest arc3.tar.

-----

9 points by pg 5811 days ago | link | parent | on: New Features

That's actually one of the things I'm working on next.

-----

2 points by projectileboy 5811 days ago | link

Thanks!

-----

4 points by pg 5811 days ago | link | parent | on: New Features

Oops, will fix.

-----

4 points by pg 5810 days ago | link

This is fixed in the latest arc3.tar. Thanks for catching it.

-----

5 points by pg 5812 days ago | link | parent | on: (coerce 0 'num)

Yes, this is a bug; fixed.

-----

2 points by pg 5813 days ago | link | parent | on: Unmarkdown

Oops, yes, thanks for catching this.

-----

2 points by pg 5813 days ago | link | parent | on: Srv.arc question

Hmm, looks like the w/stdouts in the ops are unnecessary. Thanks for noticing.

-----

1 point by pg 5811 days ago | link

Actually on closer examination I'm going to leave the w/stdouts in the op definitions. It's reasonable to have ops take a stream argument, and if they do they have to handle it correctly.

-----

2 points by shader 5811 days ago | link

Mind if I ask what the stream argument could be used for?

-----

1 point by pg 5810 days ago | link

You could for example write to a file or string if you were debugging.

-----

1 point by shader 5809 days ago | link

If it's for debugging, wouldn't it be easier if you just left it going to standard out? That way you could run it on the repl and see the output, and still wrap it in 'tostring or w/outfile if you wanted it to go to a string or file instead.

Maybe the stream argument could be made optional, and default do stdout? The redundancy would still exist, but it would allow us to use it both ways.

-----


I've never felt 100% sure about it though.

-----

1 point by Adlai 5818 days ago | link

Well, I think it adds just enough clarity to be worth the "seasickness". I guess it's also related to the indentation from CL 'cond:

  (cond ((condition1)
         (result-code1))
        ((condition2)
         (result-code2))
        (default-code))

-----

2 points by pg 5818 days ago | link | parent | on: Arc3 now the current release

Good point; thanks.

-----

1 point by pg 5819 days ago | link | parent | on: Lexically shadowing a macro?

Macros are something that happens at compile time, not runtime. A macro call looks like a function call, but it's really something completely different.

-----

2 points by rntz 5819 days ago | link

This... isn't really an explanation. Lexical bindings of things are also determined at compile time - just not the values they'll be bound to. So you can't have a locally-bound macro, but you can let locally-bound symbols shadow macros, and there's no real reason not to.

(If that first sentence doesn't seem to make any sense to other readers: What variable or relative stack position a variable will be stored in in C is determined at compile time, but the value is not. Obviously the backend isn't the same here, but the same concept holds, at least the way arc is currently implemented; in particular, there is a parameter to 'ac that indicates what symbols are lexically and locally bound. In Python, on the other hand, the local environment is accessible at runtime, so lexical bindings are not always determinable at byte-compilation-time.)

-----

1 point by almkglor 5786 days ago | link

  (mac helper (foo)
    `(do ,foo))
  (mac real-macro (bar)
    `(helper ,bar))

  (let helper
       (fn (x) (+ x 1))
    (real-macro (helper 1)))

-----

2 points by rntz 5760 days ago | link

This could be a poster child for hygienic macros.

-----

More