User-Agent: Workspace Webmail 5.14.0 Message-Id: <20150509064505.85f80dae80d1d2f2e266ec6278e6cbe8.d8cfba9712.wbe@email07.europe.secureserver.net> From: “David Demner (AquaQ)” <david.demner>
To: personal-kdbplus@googlegroups.com
Subject: RE: [personal kdb+] Parametric table =?UTF-8?Q?name=3F?Date: Sat, 09 May 2015 06:45:05 -0700
Mime-Version: 1.0
You need the variable name to be contructed before trying to assign the value to it. The () forces the parser, which evaluates from right-to-left with no operator precedence, to do it in the proper order.
Without the brackets, you'd have
{`$string[x],"Book" set ([]a:();b:())}
which would start with "Book" set ([]a:();b:()) and type out because "Book" isn't a symbol.
Round brackets act as they to in math equations but can show up in strange places like when you create function projections. For example, this is from the excellent Q-Tips book by Nick Psaris:
/ generate list of profileable functions
lambdas:{x where 100h=3D(type get@) each x}
(the alternate way to write this is x where 100h=3Dtype each get each x which uses 2 each and is thus less efficient to execute)
Hope that helps,
David
=0A
=0A=0A
Thanks Jose and David,
So I now understand that the parenthesis is mainly for grouping and making non-right to left execution order.
I am learning how to work with kdb q, mainly by reading the q for mortals tutorial and other web resource. However, it seems like that not all details are given in the “q for mortals”. For instance, I never know that the right operands of “set” can be a symbol…
I am thinking about getting the “q tips” book and wonder if it cover this sort of things that is not mentioned in “q for mortals”? Or would you guys recommending some other source of learning material?
Thank you
Gary
X-Mailer: Becky! ver. 2.69 [en]> I am thinking about getting the “q tips” book and wonder if it cover this sort of things that is not mentioned in “q for mortals”? Or would you guys recommending some other source of learning material?I’ve bought q Tips few days ago.It does cover ‘set’ and it differs in content and style from Q forMortals (which I did not finish yet also). So far I like it.-- Roman Mishin