Arc Forumnew | comments | leaders | submit | melevy's commentslogin

I meant

<pre> (entry "http://localhost:8080/said" (show (input-field a) (submit-button (show (link "Click here" (show (text "You said: " a))))))) </pre>

-----

1 point by squigg 6134 days ago | link

you have to indent the line by 2 spaces or more to get it to show as code.

   like this line here

-----


The program definition:

The program listens to 'http://localhost:8080/said'. First it shows a page with an input field and a submit button. Clicking the submit button shows another page with a link saying "click here". Clicking the link shows the last page with the text "You said: " along with the text typed in on the first page.

One might say that this is the definition, but in fact this is the solution. The verbs 'listen', 'show', 'click' and the nouns 'input field', 'submit button', 'link' or the reference 'the text typed in on the first page' are all context sensitive. A human can interpret this program by using some paper and a pen while another human could be a user. Unfortunately a computer cannot yet do this.

So how do you write it in lisp? Well, the best advice here is if you still have a couple then use your father's parenthesis. Otherwise you will have to make up some new ones such as.

(entry "http://localhost:8080/said" (show (input-field a) (submit-button (show (link "Click here" (show (text "You said: " a)))))))

Defining the terms entry, show, input-field, submit-button, link and text in a 'framework' of your choice is left to the reader as an exercise. Each one of those are generic concepts.

levy

-----