Groups
Groups
Sign in
Groups
Groups
amber-lang
Conversations
About
Send feedback
Help
Accessing location search paramters the Smalltalk way
10 views
Skip to first unread message
Tom
unread,
Mar 20, 2012, 6:33:03 AM
3/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to amber-lang
Hi all :)
I'd like to create a one page project with Amber, where that page
calls itself changing state upon the parameters in...
window location search
...if needed. Therefor I want all of these parameters accessible in a
Dictionary, in Smalltalk terms. Here's what I came up with...
| query pair |
query := Dictionary new.
((document location search trimLeft: '?') tokenize: '&') do: [ :tok |
pair := tok tokenize: '='.
query
at: pair first
put: pair second.
].
^query.
As this looks a bit monstrous to me, I wonder if it could be done more
compact?
Cheers...
Reply all
Reply to author
Forward
0 new messages