> [mailto:[EMAIL PROTECTED] On Behalf Of Oleg Kobchenko
> > Would these definitions work for qparamList & qparamPrefix?
> > Not sure if the type coercion makes much sense for
> qparamPrefix though.
> >
> > qparamList=: ''&$: : (4 : 0)
> > if. 0 > i=. (~.qkeys'') ndx_1 boxopen y do. x return. end.
> > (boxopen x) coerce each i{:: CGIKEYS</.CGIVALS
> > )
> >
> > qparamPrefix=: ''&$: : (4 : 0)
> > prefs=. (#y){. each qkeys''
> > if. 0 > i=. (~.prefs) ndx_1 boxopen y do. x return. end.
> > (boxopen x) coerce each i{:: prefs</.CGIKEYS,.CGIVALS
> > )
>
> The meaning of list and prefix can be illustrated so:
You seem to imply that the verbs above don't provide the correct
functionality?
They seem to do the job to me. What am I missing?
load 'c:\program files\j601\addons\web\jhp\jhp.ijs'
]CGIKEYS=: ;:'abc lbl abd abc abcd lbl'
+---+---+---+---+----+---+
|abc|lbl|abd|abc|abcd|lbl|
+---+---+---+---+----+---+
]CGIVALS=. ;:'v11 v21 v31 v12 v41 v22'
+---+---+---+---+---+---+
|v11|v21|v31|v12|v41|v22|
+---+---+---+---+---+---+
qparamList 'abc'
+---+---+
|v11|v12|
+---+---+
qparamList 'lbl'
+---+---+
|v21|v22|
+---+---+
qparamPrefix 'ab'
+----+---+
|abc |v11|
+----+---+
|abd |v31|
+----+---+
|abc |v12|
+----+---+
|abcd|v41|
+----+---+
qparamPrefix 'abc'
+----+---+
|abc |v11|
+----+---+
|abc |v12|
+----+---+
|abcd|v41|
+----+---+
qparamPrefix 'a'
NB. The qparamPrefix needs a tweak to cope with the singleton prefix
qparamPrefix ,'a'
+----+---+
|abc |v11|
+----+---+
|abd |v31|
+----+---+
|abc |v12|
+----+---+
|abcd|v41|
+----+---+
> > Also according to the API there should be a verb 'qparamKeys'. I'm
> > thinking this is the same as 'qkeys' so should there be an entry as
> > follows?
> >
> > qparamKeys=: qkeys
> >
> qparamKeys is more correct, because qkeys are made when there
> was only one collection: (HTTP) keys and params (values).
> Now having cookies and headers, etc. it's better to keep them
> separate. At this point it would be reasonable to deprecate
> and then remove qkeys.
Sounds sensible
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm