Lukas Renggli demonstrates the ARC Challenge in Seaside - and you can run his example by following the link:
| something |
something := self request: 'Say something'.
self inform: 'Click here'.
self inform: something
I like how he explains the solution:
Another important point is readability. Read the Smalltalk code from top to bottom. I reads like english prosa and it simply does what it says. Without bells and whistles. And - does your framework support the back button as well? Does it also prevent you from XSS attacks?
For comparison purposes, here's the Arc code:
(defop said req
(aform [w/link (pr "you said: " (arg _ "foo"))
(pr "click here")]
(input "foo")
(submit)))
I think Lukas' comment says it all. Here's the text for the challenge:
Write a program that causes the url said (e.g. http://localhost:port/said) to produce a page with an input field and a submit button. When the submit button is pressed, that should produce a second page with a single link saying "click here." When that is clicked it should lead to a third page that says "you said: ..." where ... is whatever the user typed in the original input field. The third page must only show what the user actually typed. I.e. the value entered in the input field must not be passed in the url, or it would be possible to change the behavior of the final page by editing the url.
Technorati Tags:
smalltalk, arc challenge