another smallification

is there a shorter k expression for:

? k)ab {.[x;();{x::y};y]}’ 2?10

? ?

i’m fussy: ??? p:2?10;a:*p;b:p 1 ?doesn’t count. ?

i’m looking for ?a shorter

? k){.[x;();{x::y};y]}

thanks guys ?:j

To: personal-kdbplus@googlegroups.com
X-Mailer: Apple Mail (2.1257)

I don’t think you need that at all

q)ab set’2?10
k)ab .[;();:;]'2?10

Cheers,
Attila
On 19 Apr 2012, at 12:08, Jack Andrews wrote:

> is there a shorter k expression for:
>
> k)ab {.[x;();{x::y};y]}’ 2?10
>
> ?
>
> i’m fussy: p:2?10;a:*p;b:p 1 doesn’t count.
>
> i’m looking for a shorter
>
> k){.[x;();{x::y};y]}
>
>
> thanks guys :j
>
> –
> You received this message because you are subscribed to the Google =
Groups “Kdb+ Personal Developers” group.
> To post to this group, send email to =
personal-kdbplus@googlegroups.com.
> To unsubscribe from this group, send email to =
personal-kdbplus+unsubscribe@googlegroups.com.
> For more options, visit this group at =
http://groups.google.com/group/personal-kdbplus?hl=en.

q)ab set’2?10
k)ab .[;();:;]'2?10

i want to use :: coz my expr is in a while loop and I want to set a and b globally

?

then qualify a and b.

no hits on code.kx.com for “qualify”

set is always global

You cannot refer to a parameter or local by name at all

(as they are on the stack)

Only complication is that set always works in the current namespace

What Felix probably means is that you can do `..a to make sure it is main namespace - however that is only needed if you are working with namespaces

   Attila

namespaces. qualify the names in their namespace.
the main one is .. , so ..a`..b set’2?10 does the trick but set does it globally anyway even inside of a lambda.

ab set? is enough.

atilla wrote:?

I don’t think you need that at all

q)ab set’2?10
k)ab .[;();:;]'2?10

nice one. ?and i see a clever projection here. ?and i now see that : operates?

globally in the . (apply) from other messages in the thread

thanks,

jack.