Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But you are cheating:

* you've omitted code to control the output content-type and the associated response headers (xhtml vs html)

* you've removed text, formatting from the form page

* you've discarded the results page altogether

* you aren't properly distinguishing between GET and POST

Do the same to the clojure code and it'll be about the same length as well.



Your requests, when they're valid, are embarrassingly simple one-liners.

you've omitted code to control the output content-type and the associated response headers (xhtml vs html)

Add this single line to your WITH-HTML macro.

  (setf (html-mode) :xml)  ; for XML or :sgml for HTML.
http://weitz.de/cl-who/#html-mode

you've removed text, formatting from the form page

Add one line for a CSS file inclusion and style it to your heart's content. In real web apps I use html-template to template the code, and do not sloppily generate html like I did with the example; but I had to do what the clojure code did, in the same manner.

you've discarded the results page altogether

I am printing the results on the same page. Yeah, that's a better usability.

you aren't properly distinguishing between GET and POST

Says who? the DEFINE-EASY-HANDLER takes arguments, which correspond to the submitted form elements, via GET or POST. In fact, that macro also does some type conversion for you as well; since you declared your parameters to be integers they will be converted to integers when you get them, and not remain strings. This stuff is built into the web server.

http://weitz.de/hunchentoot/#define-easy-handler

If you're gonna implement a full REST then you have no business generating your display html from within your container.

What else do you think I omitted?


It would have been easier and no less accurate for you to write, "yes, my cl code was shorter only because I omitted a bunch of stuff." If you're going to start a dick-waving contest, at least man-up and write your code so it has the same behavior.


Wow!

First sophistry and now this .. sophistication. I think I am out of my intellectual depth here, and you will have to excuse me for bidding you an early adieu!

[Edit:

I see you have only registered a day ago, welcome aboard! But can you please be a little gentle? (specially in sentences containing a 2nd person pronoun.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: