Arc Forumnew | comments | leaders | submitlogin
Asv or serve broken
1 point by eekee 5908 days ago | 5 comments
Attempting to run the "hello world of web apps" in the tutorial fails. I've tried it with and without disabling news.arc (as the tutorial suggests) with no difference. Here is what appears on the termnal running arc:

ethan@rovaniemi arc2 (0) $ ./arc.sh Use (quit) to quit, (tl) to return here after an interrupt. arc> (defop hello req (pr "hello world")) #<procedure:gs1446> arc> (asv) ready to serve port 8080 date: 1221127958: No such file or directory make-string: expects argument of type <non-negative exact integer>; given -1

=== context === cut memodate srvlog gs904 handle-request-thread

And the error output from Lynx: ethan@rovaniemi arc2 (0) $ lynx http://localhost:8080/

Looking up localhost:8080 Making HTTP connection to localhost:8080 Sending HTTP request. HTTP request sent; waiting for response. Alert!: Unexpected network read error; connection aborted. Can't Access `http://localhost:8080/' Alert!: Unable to access document.

lynx: Can't access startfile

On attempting to connect with Firefox, Arc gives the same error but Firefox displays a blank page with no error.



2 points by drcode 5908 days ago | link

I think you're seeing two different problems:

1. Linux dates are broken in pg's version of arc. See http://rcjp.wordpress.com/category/lisp/

2. Lynx isn't supported (even though I agree that's weird)

I hope pg cleans up these bugs in the next release, given that they're so ugly and so easy to fix.

-----

1 point by eekee 5907 days ago | link

Thanks for the patch link. I had to regenerate it, and I'm wondering if I missed something. The patch as I added it (attached below) does get rid of the warning from date, but all the other errors still seem to be there and Firefox still displays only a blank page, as do Links and W3M. Errors on the arc tty are very similar:

reference to undefined identifier: _ranked-stories*

=== context === newspage gs1645 gs905 handle-request-thread

Links uniquely appears to send 2 requests:

reference to undefined identifier: _subseq

=== context === date memodate srvlog gs905 handle-request-thread

reference to undefined identifier: _ranked-stories*

=== context === newspage gs1645 gs905 handle-request-thread

As to Lynx I found this forum doesn't support it either, and I'm not sure I blame it. I tried logging in from my Zaurus, only to get an error about invalid content length. I'm annoyed with Lynx more than the forum. It's been around long enough.

Regenerated patch:

--- arc.arc.orig 2008-09-11 18:42:00.000000000 +0100 +++ arc.arc 2008-09-11 18:46:32.000000000 +0100 @@ -1212,8 +1212,21 @@ (unless (dir-exists path) (system (string "mkdir -p " path))))

+(def uname nil + (let val (tostring (system "uname")) + (subseq val 0 (- (len val) 1)))) + (def date ((o time (seconds))) - (let val (tostring (system (string "date -u -r " time " \"+%Y-%m-%d\""))) + (let val (tostring (system + (string + "date -u " + (if + (is (uname) "Linux") + ;; Linux wants -d and an interval + (string "-d \"" (- 1 (since time)) " seconds\"") + ;; BSD wants -r and epoch seconds + (string "-r " time)) + " \"+%Y-%m-%d\""))) (cut val 0 (- (len val) 1))))

(def count (test x)

Edit: Fixed the newlines. >_> I hope I didn't screw up the patch.

Edit #2: Or not. What kind of forum is this? One that likes proper <p> tags... Okay, I could live with that but honestly, what kind of coding-discussion forum does that make it?

-----

2 points by almkglor 5907 days ago | link

Put two spaces before each line of code:

  ordinary text you want to put in a single
  paragraph

    (indent two spaces
      (to get code)
      (that is readable)
      (make sure
        (to put empty lines before and after)))

-----

1 point by eekee 5907 days ago | link

Ok... well I suppose I could paste errors into an editor before pasting them here.

-----

2 points by eds 5907 days ago | link

1. You could also use Anarki (see http://arcfn.com/2008/02/git-and-anarki-arc-repository-brief...), which contains many other bug fixes and enhancements.

2. Lynx works fine for my site (hosted on Ubuntu 8.04).

-----