Rebol and Web Forms Reconsidered
I’ve been considering changing the behaviour of my AltWebForm module. Currently the script extrapolates meaning from keys to produce deeper data structures:
post.title=Something&post.tag=one&post.tag=two
Becomes:
post [
title "Something"
tag ["one" "two"]
]
The first consideration is that a repetitive tag implies a block instead of a single value. This causes a problem in validation as any value can become a block:
post.title=First&post.title=Second
My first proposed change then is that a repetitive value overwrites the previous value, so the above becomes:
post [title "Second"]
The second consideration is how then to handle values that are legitimate collections?
My second proposed change then is that a key that represents a block of values end in a period:
post.tag.=one
post.tag.=one&post.tag.=two
Becomes:
post [tag ["one"]]
post [tag ["one" "two"]]
Respectively.
Please post comments to the [Rebol and Red] chat room.