@dzaima ah, i see :) unlike in apl, locals don't spring into existence only after you assign to them. they exist from the beginning of the invocation of the function, initialized with ::.
both dicts and tables are physically represented as pairs of (keys;values)
but conceptually, a table is a list of dicts
when you index a table with an int, you get back a dict, as if you've indexed each of the columns individually and slapped the same set of keys on them
and when I evaluate a, I don't get back 2 3⍴1+⎕io-⍨⍳6
@ngn I think it warrants a bit of explanation
especially for actually wanting to see the damn table right
I got all my variables all nice and evaluated, I now want to SEE THE TABLE, but all i get is how I would have encoded the table I want to seee, but I never see the table
@nathanrogers ok, let me try to say it another way: the programmer and the interpreter communicate using the same language. if the interpreter writes (1 2 3;4 5 6), that matches the value produced when the programmer types (1 2 3;4 5 6).
like, I'm a data scientist, and I'm hoping to identify the relationships between certain records... y'know, in a table, so I whip up a table literal expression
@nathanrogers it's primarily for the cases when you don't fully know what object you've created. (but i also agree that having pretty formatting as at the very least an option, for a database language of all things, is good)
@nathanrogers it doesn't just repeat what you typed. it evaluates it and prints a simple representation of the result. this expression just happens to be simple enough to represent itself.
yeah, I can't understand the point of a literal notation for a data structure, and then not actually evaluating the data in terms of the encoding of the data structure
@dzaima and why is that something that would ever cross anyones mind aside from nice cases when you want a concise format for representing a given data structure
@nathanrogers it's easier to learn the language when you know that the output contains complete information about the value being displayed, and you know that you can paste it back
@ngn 1) i highly doubt that helps at all with learning. You might learn dyadic ! and vector syntax faster, but that's about it. I don't think one is significantly less likely to misunderstand syntax than pretty boxes, but pretty boxes are much better at actually helping to understand what data you have (a +…!… table representation is just horrible, you can't at all see a row as a single "thing");
@dzaima 2) Anyone that doesn't already know k wouldn't ever think of using copy-pasting as a means to copy data
@nathanrogers i'm trying to make a point with that "captcha": if in the output 0 as an int is indistinguishable from 0 as a char, it's harder for beginners to learn that language
@ngn I'd estimate the number of people that are annoyed by tables being ugly to be much greater than the number of people who take advantage of output copy-pasteability
when learning, implementing, debugging.. the language i'd rather be able to tell precisely what value i'm looking at, and paste it back if i want to experiment with it more
@nathanrogers i'm a language geek, not a data scientist. big data tools must be built on top of something. i'm trying to make that something, not the end-user tools themselves.
@ngn i might have been a bit too harsh with "not for actually getting things done". Point remains though, ngn/k isn't really fit for data scientists if it can't display a readable table
@dzaima I'm not a data scientist, and it wont be useful for me if I can't observe the contents of a table ... as a table
@ngn pretty printing... i swear you guys have your OWN definitions and you just don't tell anyone else about them... you're talking about printing literally anything ever
not some kind of fancy shmancy, featureful, configurable kind of printing with all sorts of niceness
like, if a literal notation to descibe tables, doesn't describe a table, and instead describes the literal notation of the table you've already notated
@Wezl that's completely irrational and illogical. the painting of a pipe is not a pipe, the MD encoding of an HTML table is NOT an HTML table... try to render that as HTML, doens't work without the MD parser converting it to an HTML table
even the HTML encoding of an html table is not a table
it is a representation of the table
only the page once rendered does the HTML encoding of an HTML table become an HTML table
@nathanrogers ngn/k defines a table as a flipped dictionary and literally nothing else. You may want to use it to mean some 2D thing, but that's unrelated, other than that the name might be equal.
@nathanrogers but it is a table because a table is a representation of data in some rectangle and a markdown table is representing the data in a rectangle, that happens to be made out of ascii characters instead of the pixels a rendered HTML table is made out of
@nathanrogers if you padded it with spaces to align the columns, then it magically becomes a table? isn't that just a different representation of a table? what even is a "table"?
@ngn I feel like I should clarify.. my criticism was about the representation of tables, not intending to criticize the language. but that I felt the representation is not useful
@rak1507 k has no deep scalars. the closest equivalent to apl's ⊂ is "enlist" (monadic ,) which is more like ,⊂⍵. and there's no "..-if-simple" of course.
the last expression in {} is returned, so if you insert a newline just before the }, there would be an empty statement at the end, so the result would always be ::
@nathanrogers well, yes. ; and \n both do that. they are equivalent.
@nathanrogers how familiar are you with k4? I think a lot of these differences (how tables are output, continuation lines, etc.) are present there as well
@nathanrogers I tried using emacs, but only to use SLIME and that didn't even work :|. It's tolerable with evil but I have a friend with like 30 MBs of free space on one computer because they have doom, while vis is 0 MB + lua + syntax highlighting
@rak1507 I guess I don't encroach on the limitations of MD. either that I fit what I want within the box of what I know is possible in MD
@Wezl I used vim + vundle forever. I still actually kinda prefer tmux with vim-slime because I can do slime-like things with every language, rather than just lisps or schemes