Arc Forumnew | comments | leaders | submitlogin
Initial problems
3 points by jsgrahamus 5046 days ago | 11 comments
I've downloaded and installed mzscheme 3.7.2 and untar'd arc into the same directory wherein lie the executables.

I can call arc with the normal call:

mint@mint ~/bin $ ./mzscheme -m -f as.scm Use (quit) to quit, (tl) to return here after an interrupt. arc> (quit)

However, when I put that command string into an executable file, I get problems:

mint@mint ~/bin $ cat arc ./mzscheme -m -f /home/mint/bin/as.com mint@mint ~/bin $ ./arc default-load-handler: cannot open input file: "/home/mint/bin/as.com" (No such file or directory; errno=2) >

Why doesn't that work?

My other question is I would like to be able to search the forum. How can I do that?

Thanks, Steve



4 points by evanrmurphy 5046 days ago | link

> My other question is I would like to be able to search the forum. How can I do that?

The lack of an onsite search bar is a frequent question/criticism here as well as on Hacker News. Offsite, Search Arc Forum [http://af.searchyc.com/] nicely provides the functionality. Querying Google with the format

  site:arclanguage.org <your query here>
also works.

-----

1 point by jsgrahamus 5046 days ago | link

In running through the tutorial, I did the following:

  arc> (defop hello req (pr "hello world"))
  #<procedure: gs1709>
  arc> (asv)
  ready to serve port 8080

  ^Z
  [1]+  Stopped                 ./goarc
  mint@mint ~/bin $ ./goarc
  Use (quit) to quit, (tl) to return here after an   
  interrupt.
Then I wanted to try some more, and it seems that the port is still in use.

  arc> (defop hello2 req (w/link (pr "there") (pr "here")))
  #<procedure: gs1709>
  arc> (asv)
  Error: "tcp-listen: listen on 8080 failed (Address   
  already in use; errno=98)"
  arc> (load "blog.arc")
  nil
  arc> (bsv)
  Error: "tcp-listen: listen on 8080 failed (Address 
  already in use; errno=98)"
Is there some way to turn the port off, or stop whatever is listening on it?

Thanks, Steve

-----

2 points by jsgrahamus 5046 days ago | link

Answered my own question, again. Had a stopped job.

Sorry.

-----

1 point by rocketnia 5046 days ago | link

As you demonstrate, your file does not contain the same thing as the original command you used. I think it would help to replace ".com" with ".scm".

By the way, to use preformatted text, indent each line with two spaces. Also, you can use asterisks for italics. There's actually an instruction page for this somewhere, but I can't find the link either, so no worries. :-p

Also, I don't mean to burst your bubble, but the main Arc page gives old installation instructions. You don't have to get an old MzScheme version as long as you get arc3.1.tar. http://arclanguage.org/item?id=10254

-----

3 points by fallintothis 5046 days ago | link

http://arclanguage.org/formatdoc

-----

3 points by akkartik 5045 days ago | link

It's really too bad that link's no longer around textareas. The only place HN and this forum link to it is in edit textareas..

-----

1 point by jsgrahamus 5046 days ago | link

The first 3 examples of hello all functioned as I thought they should. But when I got to the fourth one, I expected a form with some prompts and a link. Rather, all I got was a web page saying It's alive. Where did that come from?

The code follows:

  arc> (defop hello req (aform [w/link (pr "you said: " 
  (arg _ "foo"))
                               (pr "click here")]
                               (input "foo")
                               (submit)))
  #<procedure: gs1709>
  arc> (asv)
  ready to serve port 8080

-----

1 point by evanrmurphy 5045 days ago | link

"It's alive." is just a tongue-in-cheek message printed by default to the root page (probably http://localhost:8080/) of a running instance of the Arc server. You can see where it comes from if you open the file srv.arc in your arc directory and look for the line:

  (defop || req (pr "It's alive."))
The || from that is a symbol for empty, so just as your (defop hello ...) command puts a page at http://localhost:8080/hello, (defop || ...) puts a page at http://localhost:8080/. (Nothing comes after that final slash since we used the empty symbol instead of "hello".) You could replace the default "It's alive." message by running a command like

  (defop || req (pr "jsgrahamus rox!"))
at the REPL.

Were you able to get this stuff working, by the way, or are you still stuck??

-----

1 point by akkartik 5045 days ago | link

Go to http://localhost:8080/hello

-----

1 point by jsgrahamus 5046 days ago | link

Thanks for your help.

Another question. I assume that this line is trying to change "99" into a number base 16, but it doesn't seem right.

  arc> (coerce "99" 'int 16)
  153

-----

2 points by jsgrahamus 5046 days ago | link

I got it. It's trying to output in decimal what 99 base 16 is.

-----