So for the line “nsfi”$:() it is actually casting an empty list with every type on the left (hence each left) so that it creates a list of that specific type. You can use .Q.s1 to view the string representation of the object.
bang (!) is used to create a dictionay with the keys on the left and values on the right with the correct length of list. Then flipping a dict will turn it into a tbl.
Yes, it is creating a table schema of specific type for the cols. So when you are manipulating the table, it throws a type error if the type is not of that defined in the schema.
The [q Reference](“https://code.kx.com/q/ref/” "“q”) aims to answer questions such as yours and I am always looking for ways to improve it.
Did you look there for answers? If so, I would be very grateful for anything you can tell me about what worked and how far you were able to get with your three questions before getting stuck.
Hi @SJT, actually I did try finding answers from Refererence card (https://code.kx.com/q/ref/) as well as Overloaded glyphs (https://code.kx.com/q/ref/overloads/)"). For some simpler questions, I can find solutions directly from them. However, I think the combination is a bit too complicated for a beginner like myself and I failed to understand what exactly the statements are about even after looking into these two pages…
I can see this might have required some experimenting to find which parts of the expression are themselves valid expressions. A text editor with q syntax highlighting (I use Sublime Text) might be helpful here.
What would it helped to have looked up but could not?
lol but think about it…you know how to evaluate “parts” of the expression because you already know which characters are one “part”. For me (well at least the me a few days ago), it is like this: