The scheme way is also the ruby way, so it's probably the most conventional. I could see us using join/d though, as it looks kinda like the w/link method in the arc challenge, so we could be starting our own convention. Personally, I'd love to see a convention for predicates to end in '?', which would go along with the '!' convention quite well.
Except that the ruby way isn't consistent. ! is used to warn people that this method is destructive for sure. The lack of ! doesn't imply non-destructiveness.
>> We wouldn't want one user's file to upload over another, when we're still trying to shrink and process it. How do we avoid orphaning images if users re-upload things?
>Tough. Not sure what you exactly mean with this though.
>> Should user icons be considered the same sort of thing as gallery images?
>Not sure what you mean by this either. What do you mean by "user icons"?
Most forums and art sites let their users upload a little picture, which is placed by each of their comments or posts. The difference between this and a normal image on the site is that, while other pictures may exist in different forms (e.g. full view / original, medium size, and thumbnail), user icons often only show up in one small standard size, and the original image they were shrunken from is not saved.
EDIT: made it use sessions to answer the question properly
Here's a solution using the lovely simple web api Sinatra (http://sinatra.rubyforge.org/). How many tokens is this? I didn't use any form helpers, but I'm assuming string literals count as one token.
require 'rubygems'
require 'sinatra'
get '/' do
'<form action="success" method="POST"><input name="message"><input type="submit"></form>'
end
post '/success' do
session[:message] = params[:message]
'<a href="show"> click here </a>'
end
get '/show' do
"You Said: #{session[:message]}"
end
This solution blows--like many others--because it explicitly references a session. Additionally, explicitly referencing a form instead of implicitly providing form values to a procedure is pointless drudgery. Explicit session and state are like having to access all of your Python variables via globals['foo'] or locals['bar'].
The Arc Challenge isn't about Turing completeness: We know you can build a web app using an app server written in Conway's Game of Life, and while that's an interesting curiosity, it's not something that's pushing forward the state of the art. The challenge--for me, at least--is about thinking about how we can make the plumbing of a web application disappear, so we don't need to think about it any more.
>As for searching, the best way is probably to do a Google search for "my query site:arclanguage.org".
True, and I'd figured that out, but neglected to mention it because I still couldn't find what I wanted.
Anyways, search is an important feature these days that every site with some dynamic content should have. You can't expect google's indexer to keep up with all your changes, and a forum with any sort of scale should encourage its users to search for duplicate topics before starting their own lest redundancies abound. I'd like to see an arc solution for searching on these posts.
It does work, but don't do that :) At least if you're generating, for example, very big lists : everything evaluated in your program will be displayed. If your code contains something like (= foo (range 1 1000000)), you'll somewhat regret it...
But, in many cases, that will work just fine, despite the noise generated by the repl. You can also do mzscheme -m -f as.scm < myprogram.arc >/dev/null to turn the whole output off (in case you don't need it at all).