Arc Forumnew | comments | leaders | submitlogin
A webapp for logging running distance I made with arc (tracksruns.com)
24 points by brett 6134 days ago | 15 comments


7 points by brett 6134 days ago | link

It's sort of an alternate ending to http://dontbreakthechain.com which I made last year.

The source is at: http://goods.tracksruns.com/runs.arc.txt

I'm new to lisp, I welcome (encourage even) tips/pointers/recommendations.

-----

2 points by CatDancer 6133 days ago | link

  (def dl> (dl1 dl2)
    (let (y1 m1 d1 y2 m2 d2) (join dl1 dl2)
      (or (> y1 y2)
      . . .
"with" is a form of "let" that lets you make multiple assignments at once, so you wouldn't need the "join":

  (def dl> (dl1 dl2)
    (with ((y1 m1 d1) dl1 (y2 m2 d2) dl2)
      (or (> y1 y2)
      . . .
you'll notice the extra layer of parentheses, which is how "with" knows that you've stopped defining variables and have started the body.

-----

1 point by brett 6133 days ago | link

Thanks. I'm aware of with, I just thought I'd save some parens. Yours does read a bit easier.

-----

1 point by brett 6133 days ago | link

The other thing I'm noticing is that I've been nesting lets when the second assignment depends on the first. I think I should be using withs which I did not know about.

-----

3 points by icey 6134 days ago | link

I have a user request for you!

I sent this on to some runner friends of mine, and a couple of them said it'd be pretty cool if there was an optional box for "time run" as well. (Marathon runners like to train by time, I guess).

-----

3 points by brett 6133 days ago | link

That would be a natural next step. Unfortunately I think I'm tapped out on larger blocks of arc hacking for a little while.

-----

2 points by NickSmith 6134 days ago | link

Thanks Brett. For whatever reason I learn much more from working through applied code than from tutorials and the like. This is great. :)

-----

2 points by sacado 6134 days ago | link

Very good app. This (and its source code) is the kind of things that makes me sure Arc is really a great language for webapps... How long did it take you to make it ?

-----

6 points by mattjones 6134 days ago | link

Seconded. Reading the source code is a lot of fun. It's well organized and really makes the case for Arc's approach to HTML. I know I'm a convert; having stuff in so many separate files, MVC style, feels like sludge compared to this. Even if you do have to start breaking things into separate files as the app gets more complex, being able to start out like this is a serious gain.

-----

3 points by brett 6133 days ago | link

Thanks. I'm not sure exactly how long. There was a lot general arc exploration mixed in with hacking on the app.

-----

2 points by bootload 6133 days ago | link

Nice effort brett & thanks for adding the source code. If you push the dates out to 2034, first of Jan differs b/w tracksruns & gnome clock 2.2 But considering the lack of libs I can't complain.

-----

3 points by brett 6133 days ago | link

Thanks for the double check. But I get the same on both tracksruns and iCal for Jan 2034: starts on a Sunday ends on a Tuesday.

edit: So far the earliest month I've found that's off is 2101.

-----

2 points by inchforward 6132 days ago | link

Do you have a blog somewhere? Have you written your thoughts on Arc versus other languages/frameworks you know? What did you like, What was hard, What was surprising, etc?

-----

1 point by jt 6133 days ago | link

This rocks. I've been waiting years (I'm not making that up -- years!) for a guy to re-write his running site in C#, SQL Server, and who knows what other heavyweight tools, and you cranked this out in a matter of days, and in a couple of pages of code. Granted, that other site has many more features, but still. A pretty good testimony to Arc, if you ask me.

-----

1 point by byronsalty 6134 days ago | link

Awesome.

-----