(imported topic written by JasonWalker)
I’m building a client-side parser to try to determine which action was executed most recently. Sparing the gore of getting a set of actions from the client, I’m going to narrow this down to the simplest form. Given a plural set, I want to find which “item 0” goes with the maximum “item 1”. With the following example, how can I return “c”?:
q: (“a”,“Mon, 19 May 2014 16:00:00 -0500” as time; “b”,“Mon, 19 May 2014 17:00:00 -0500” as time; “c”,“Mon, 19 May 2014 18:00:00 -0500” as time)
A: a, ( Mon, 19 May 2014 16:00:00 -0500 )
A: b, ( Mon, 19 May 2014 17:00:00 -0500 )
A: c, ( Mon, 19 May 2014 18:00:00 -0500 )
T: 0.063 ms
I: plural ( string, time )
q: items 1 of (“a”,“Mon, 19 May 2014 16:00:00 -0500” as time; “b”,“Mon, 19 May 2014 17:00:00 -0500” as time; “c”,“Mon, 19 May 2014 18:00:00 -0500” as time)
A: Mon, 19 May 2014 16:00:00 -0500
A: Mon, 19 May 2014 17:00:00 -0500
A: Mon, 19 May 2014 18:00:00 -0500
T: 0.061 ms
I: plural time
q: maximum of items 1 of (“a”,“Mon, 19 May 2014 16:00:00 -0500” as time; “b”,“Mon, 19 May 2014 17:00:00 -0500” as time; “c”,“Mon, 19 May 2014 18:00:00 -0500” as time)
A: Mon, 19 May 2014 18:00:00 -0500
T: 0.117 ms
I: singular time
If I try to use either (maximum of items 1 of it) of (my set), or if I try a “whose (item 1 of it = maximum of items 1 of it)”, the inspector breaks down the set and evaluates on each element in the set; so I get plural results (actually, I get every result), as in
q: (maximum of items 1 of it) of (“a”,“Mon, 19 May 2014 16:00:00 -0500” as time; “b”,“Mon, 19 May 2014 17:00:00 -0500” as time; “c”,“Mon, 19 May 2014 18:00:00 -0500” as time)
A: Mon, 19 May 2014 16:00:00 -0500
A: Mon, 19 May 2014 17:00:00 -0500
A: Mon, 19 May 2014 18:00:00 -0500
T: 0.154 ms
I: plural time
If I try to coerce a “set”, I can’t seem to do that either. It seems I can’t use tuples in a set?
q: elements of set of (“a”;“b”;“c”)
A: a
A: b
A: c
T: 0.064 ms
I: plural string
q: elements of set of (“a”;“b”;“c”)
A: a
A: b
A: c
T: 0.064 ms
I: plural string
q: elements of set of (“a”,1; “b”,2; “c”,3)
E: The operator “set” is not defined.
Any advice?