A Short Pamphlet: HomePage example, question about what it is doing.

167 views
Skip to first unread message

Nick Mudge

unread,
Mar 1, 2010, 11:01:52 PM3/1/10
to potion
In the doc "A Short Pamphlet" (http://github.com/fogus/potion/blob/
master/doc/start.textile)
there is this example:

HomePage get = (url):
session = url query ? at ('session').

I understand that HomePage is a class and this example is defining a
method called get. I understand that the question mark is used to
query the "query" object to see if the "at" method exists in it.

If the "at" method does exist because "query" is a table then the
'session' key is looked up in query and the value is returned.

If the "query" object does have a key called 'session', I am wondering
how the returned value then affects the url object.

I understand that the point of this example is to show how the
question mark syntax is used in a more practical example, but I was
wondering if the whole thing was supposed to make sense and if so, how
does the returned value from query affect the url object, or is the
url object a function that takes the returned value as an argument?

Trying to understand what the get method is supposed to do and how it
would work.

Reply all
Reply to author
Forward
0 new messages