Arc Forumnew | comments | leaders | submit | adm's commentslogin
4 points by adm 5095 days ago | link | parent | on: Debug Macros

fallintothis helping on how not to fallintomacro trap.

-----

1 point by adm 5215 days ago | link | parent | on: Arcc: arc compiler in arc (self-hosting)

a clickable link of source : http://github.com/nex3/arc/tree/arcc

-----

1 point by adm 5216 days ago | link | parent | on: Function overloading

extend looks good. but I don't understand where one can use it, apart from extending a function for different types.

-----

1 point by aw 5216 days ago | link

In the Arc server, I moved creating the request object out of 'respond (http://awwx.ws/srv-misc), so that 'respond is now being passed the request object and does the usual Arc srv action to respond to a request: look to see if there is a defop etc. defined for the request path.

Now I can extend respond to implement my own ways of responding to requests: I can easily have my own way of choosing which action to take (I can have http://myserver.com/1234 display the "1234" item page, for example), or implement my own kinds of defop's.

-----

1 point by adm 5215 days ago | link

I see it now. So type based dispatch is just one of the cases where it can be used. Thanks for the explanation. but why rntz says it's less efficient?

-----


maybe work on this can be resumed after, Rokudo star release.

-----


wow. Let's say it's possible to call any library in any language(I've no idea how:) ) and we are able to do that (only) for s-expression based languages, we are set. We can use all the libraries of those languages, as Arc evolves.

-----

5 points by adm 5374 days ago | link | parent | on: Show Arc: first program

Thank you for writing such a long text. I sure could have avoided most of the syntax errors if had run it at least for once, but it serves me right by not doing so. This is my first arc program, but I think if I get such valuable comments, soon I will be writing good, idiomatic Arc code.

-----

1 point by adm 5375 days ago | link | parent | on: Show Arc: first program

Thanks for comments. No I have not run the code yet(and not even compiled).

Just to understand it: you say "c!fellas" => (c 'fellas), will that fetch the 'fellas element of c?

-----

1 point by conanite 5374 days ago | link

If c is a table, it will return the value stored with the key 'fellas

But watch out, you have a lot of

  (each c u ...
, where u is universe; universe is a table. You probably want something like

  (each (pos cell) u ...
because that's how 'each works with tables.

In 'init-universe, you have

  (= (pos u) (create-cell i j))
(pos u) needs to be the other way around:

  (= (u pos) (create-cell i j))
and you can shorten it to

  (= u.pos (create-cell i j))

-----

1 point by adm 5376 days ago | link | parent | on: how to refactor this code?

those three methods are similar except line processing. Can't we refactor those, where they will call a single method or macro?

-----

3 points by CatDancer 5376 days ago | link

untested, but perhaps something like this?

  (def ffilter1 (file func (o fldsep whitec))
    (ffilter file (fn (line)
                    (func (tokens line fldsep)))))
and similarly define ffilter2 using ffilter as well.

-----

1 point by adm 5376 days ago | link

  (def ffilter1 (file func (o fldsep whitec))
    (ffilter file [tokens _ fldsep]))
this should work? (just curious: since I don't have access to arc right now).

-----

3 points by absz 5376 days ago | link

You want

  (def ffilter1 (file func (o fldsep whitec))
    (ffilter file [func:tokens _ fldsep]))

-----

1 point by adm 5376 days ago | link

oops! I will test with this.

-----

5 points by adm 5377 days ago | link | parent | on: Arc 3.1 (works on latest MzScheme)

hmmm...still no update in the tutorial.

-----

10 points by garnet7 5376 days ago | link

Docs can make or break a free software project.

-----


thanks.

-----

More