Arc Forumnew | comments | leaders | submit | akkartik's commentslogin
1 point by akkartik 4132 days ago | link | parent | on: About a example in arc-handbook!!!

Unfortunately this site is entirely unrelated to http://altarica.labri.fr.

-----

1 point by Jetlee 4132 days ago | link

what do you mean? I encounter a problem in using Arc.

-----

2 points by akkartik 4131 days ago | link

The command set arc.shell.preprocessor.default.command "/usr/bin/cpp" isn't legal arc (the one this forum is about). From googling around, the handbook you're reading (http://altarica.labri.fr/docs/arc-handbook.pdf) seems to be about that link I mentioned above.

Anyway, tell us what you are trying to do, and I'll tell you which of these is better for you :)

-----

1 point by Jetlee 4131 days ago | link

I'm a student. Recently, I learning Altarica for analysis a model(system). But I don't kown how to do when I encounter some problems, like I mentioned above. Now, I try a case 'Design of a lift', when I analysis it's safety, it's report a error.

-----

2 points by akkartik 4131 days ago | link

This forum isn't for the Altarica. It's for an unrelated programming language called Arc. Sorry about the confusion.

-----

1 point by Jetlee 4131 days ago | link

I hope you can help me. Thank you.

-----

2 points by akkartik 4136 days ago | link | parent | on: Why is "do" a macro and not a function?

So you mean (def newdo args)? My mind is blown.

-----

3 points by Pauan 4136 days ago | link

Well, no, because "do" returns the last argument, so it would be:

  (def do args (last args))

-----


Yeah, that's a bug on my part in anarki. Thanks for the report!

Edit 10 minutes later: now fixed: https://github.com/arclanguage/anarki/commit/fcfbfcdb80. Thanks again.

-----

3 points by akkartik 4145 days ago | link | parent | on: Interested in being an Arc tutor?

I think I might be interested. I've been working on teaching people programming a lot, but haven't really had a chance to teach my favorite language. Are you thinking in person or over video conference?

-----

2 points by jackcouch 4145 days ago | link

Video (Google hangouts?) when needed, but most of the time (once I'm up and running especially) email will probably be fine.

-----

2 points by jackcouch 4145 days ago | link

Actually I live in the SF area (eastbay) so if it is helpful to be in person I can do that too. I'm flexible.

-----

1 point by akkartik 4145 days ago | link

Me too. How about we get together in person to discuss more details?

-----

2 points by jackcouch 4145 days ago | link

Sounds great. My email is jack8couch@gmail.com. Send me your contact info. Really looking forward to it.

-----

1 point by akkartik 4147 days ago | link | parent | on: Executing files in windows

Great! Keep asking us questions as you do more learning.

-----

3 points by akkartik 4150 days ago | link | parent | on: Executing files in windows

I think that should be platform-independent:

  arc> (load "foo.arc")
Am I misunderstanding your question?

(Sorry about the delay in noticing your question.)

-----

2 points by zck 4149 days ago | link

This should work as long as foo.arc is in the same directory you're running Arc out of.

If your file is somewhere else, you'll have to specify the full path to it (warning: untested):

  arc> (load "C:\\Users\\Benben\\Documents\\foo.arc")

-----

2 points by akkartik 4156 days ago | link | parent | on: Passing a string to defop for the url?

defop is a macro that doesn't evaluate its first arg. So your question is similar to asking why this doesn't bind y to 34:

  (let x 'y
    (= x 34))
To do what you want you'll need to define the url directly. The definition of defop (approximately, after dropping some indirections) is:

  (mac defop (name parms . body)
    `(= (srvops* ',name)
        (fn ,parms
          ,@body)))
So you can do:

  (let url "hello"
    (= (srvops* sym.url)
       (fn (output req)
         (w/stdout output
           (prrn)
           (pr "hello world")))))
There's a few extra details here. You have to work through the details of how defop is defined. Feel free to ask more questions if something is unclear.

-----

2 points by bh 4156 days ago | link

Thanks, I got it. Also, is there a way to catch all requests?

-----

1 point by akkartik 4156 days ago | link

Can you elaborate? You want to call the same function on any request, and pass in the url from the request? Are you using arc 3.1 or anarki?

Edit: on anarki you get this behavior by replacing the function respond in lib/srv.arc with this code:

  (def respond (out req)
    (w/stdout out
      (prrn "HTTP/1.1 200 OK")
      (prrn "Content-Type: text/html; charset=utf-8")
      (prrn "Connection: close")
      (prrn)
      (wildcard-handler req)))

  (def wildcard-handler (req)
    (prn req!op))
This will display whatever op you request.

-----

2 points by akkartik 4157 days ago | link | parent | on: Modified/updated Semi-Arc for Android

That would all be awesome.

I've been building my latest project atop anarki. It would be most interesting to try it on android: http://github.com/akkartik/mu

-----

1 point by akkartik 4157 days ago | link | parent | on: Modified/updated Semi-Arc for Android

Nice! What does the 'oa' stand for? :)

Also, can you summarize what changes you made?

-----

2 points by c-a-smallwood 4154 days ago | link

Modernized the main user interface and unified the Semi-Arc jar and apk sources. At the moment, I'm doing a cleanup/rewrite of most of the major internals because (as stated by the original author) everything is far from optimal in the performance market. After that, I plan to make a branch of anarki's arc code be the main library. So it'll be like anarki on android!

-----

1 point by akkartik 4154 days ago | link

Nice! This might get us to replace srv.arc with app-development tools. Though it would be neat to see a webserver running on my phone :p

-----

2 points by c-a-smallwood 4157 days ago | link

And the "oa" stood for "on Android". Originally, it was just a command-line .jar

-----

1 point by akkartik 4157 days ago | link

Hmm, doesn't look like all the sources are there. I think you left out those for libs/semi_arc.jar?

I think we arc folks care even more about looking at the sources than running it :)

-----

2 points by c-a-smallwood 4157 days ago | link

Whoops! I'll upload the latest one which has all of the source in one project. The original author left the sources separate like that, so I had to do some digging and splice it together.

-----

1 point by akkartik 4172 days ago | link | parent | on: OT: Contract jobs

I hope you find something soon!

-----

2 points by jsgrahamus 4172 days ago | link

Thanks.

-----

More