| I'm new to Lisp and Arc but really loving it so far. I'm trying to make a simple website for shuttle schedules. It has a handful of routes called 10a, 10b etc. which I'm using as symbols: (= routes* '(10a 10b 15a 20a 20b 30a 30b 30c 40a 59u))
There's a dummy main page at /shuttle with links for each route: (defop shuttle req
(each r routes* (link r (nbsp))))
This displays the links fine, but they don't point to /10a, /10b, etc. as they should. Instead they all point to /%C2%A0 . Is this some evaluation of the character 'r' instead of my route symbols?Then I'm trying to make a page for each route. Instead of writing 10 identical defops, I tried to make a macro (rdefop) so I could loop through writing a defop for each route: (mac rdefop (r)
`(defop ,r req
(pr "Schedule for " ,r " goes here")))
(each r routes*
(rdefop r))
For each of the symbols in routes* , I hoped this would generate a page at the corresponding URL. So I wanted to see a page at /10a with text "Schedule for 10a goes here", one at /10b with text "Schedule for 10b goes here", etc. The above code instead creates a page at /r with text "Schedule for 59u goes here" (59u is the final symbol in routes*).I'm clearly having newb confusion with simple evaluations and macroexpansions, but I've been debugging for hours and can't get it working correctly. If anyone has advice for how to fix the above I'd greatly appreciate it. Thanks so much! |