|
6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today Set by moderator on 28 July 2015. |
|||
|
01:34
vendethiel joined
06:37
FROGGS joined
|
|||
| masak | oh? | 07:35 | |
|
08:02
FROGGS joined
15:51
Ven joined
16:12
Ven joined
16:33
Ven joined
16:47
Ven joined
|
|||
| Ven | very small change though... | 16:48 | |
| Ven admits to not being a huge fan of the README, because oftentimes, he just wants to know what the project is about | 16:49 | ||
|
17:14
FROGGS joined
18:18
vendethiel joined
|
|||
| vendethiel | "destructors"? | 18:20 | |
| masak | people seem to either love or hate the README. those who hate it seem to be a smaller group, and they say something much like that: "it's not to-the-point enough" | ||
| at this point, I'm guessing I'm confusing "many people" with "many complaints from one person", though :P | |||
| vendethiel: I don't know where I picked up that term as meaning "getters" -- probably reading about algebras or something | 18:21 | ||
| vendethiel | ETOOOVERLOADEDINPROGRAMMINGINGENERAL? | ||
| masak | "deconstructors" would've been more clear, but that's not what I've seen in the literature | ||
| vendethiel | .oO( what're you doing to my cons? ) |
18:22 | |
| masak | :) | 18:23 | |
| vendethiel | I'm not sure I "believe" in "value" | 18:25 | |
| 'specially if you want to add types on top of it | |||
| (there are some very nices papers about adding typing stuff *on top* of a language) | |||
| masak | that sounds interesting. do you have the references handy, perchance? | 18:37 | |
| also, I don't see the connection between value() and types. my first hypothesis is that you're confused as to what they do ;) | 18:38 | ||
| vendethiel | I'm thinking of the "IntStr" and stuff in Perl 6 | 18:40 | |
| vendethiel realizes he still hasn't read "First-class macros have types (A. Bawden)" | 18:43 | ||
| aw, well, I don't know where I put that paper :[ | |||
| masak | I'm not suggesting anything like "IntStr", though | 18:49 | |
| I'm just saying that it looks better if what's currently `my_int_literal.int()` instead were `my_int_literal.value()`. etc str and array | 18:50 | ||
| vendethiel | oooh, yeah. | 18:52 | |
| :P | |||
| yeah. | |||
| sounds like that'd be a role for the dynamic part (OO) of the language, though? | 18:53 | ||
| > class Q::Arguments: Array<Q::Expr>; | 18:57 | ||
| please. no non-matching brackes :[ | 18:58 | ||
| s/s\\b/ts/ | |||
| masak | "non-matching brackets"? where? | 19:00 | |
| vendethiel | <> | 19:03 | |
| I mean. | |||
| sorry. | |||
| "brackets that are already used in a non-matching fashion" | |||
| "Tuple classes" = newtype? | |||
| masak | I'm sorry, I can never learn what keywords like "newype" mean :( | 19:09 | |
| I learn them over and over, in various Haskell tutorials, but they never stick | |||
| vendethiel | it's just a wrapper "around" a type. Pure love. | 19:10 | |
| literally just creates a container so that you can't, say, add Meter and Int | |||
| masak | I just saw your email about it. let me ask a follow-up here. | ||
| vendethiel | newtype Meter Int | ||
| masak | `newtype Arguments = (Expr, Foo)` | ||
| vendethiel disabled github emails because he gets far too many | |||
| masak | I only get emails from you :P | ||
| vendethiel | that's one syntax. The other one would just be newtype Arguments (Expr, Foo) (or even without the parens) | ||
| oh, only from 007? | 19:11 | ||
| maybe I should enable it for specific repos | |||
| masak | currently, yes. | ||
| vendethiel guessed it wasn't literally "just him" ;-) | |||
| masak | I like getting them, so that's fine | ||
| no, I mean I get 007 stuff, and you're the one who is active right now ;) | |||
| vendethiel | yes, got it :) | ||
| masak | `newtype Arguments = (Expr, Foo)` seems like a good solution to tuple classes. I don't see how it solves what I want for array types at all. | 19:12 | |
| but maybe you were talking about tuple classes? | |||
| vendethiel | that seems to be what you said, yes? | 19:13 | |
| I mean -- classes that just are a tiny wrapper around a few parts, right? | |||
| masak | the sum total of my `class` proposal right now has three parts: "record" types (with attributes), "tuple types" (fixed tuple of heterogenously typed elements), and "array types" (array of unknown length but with same-typed elements) | 19:29 | |
| record types would go well with attribute and method access; tuple types with the 'case' statement; array types with indexing and array operations | |||
| vendethiel | tuple types with case statements? | 19:32 | |
| "newtype", I believe, could go for the 2nd/3rd part | 19:33 | ||
| masak | I don't see how it could do the 3rd part. | 19:45 | |
| your `newtype Arguments = (Expr, Foo)` syntax above seems to completely miss the point -- unless I completely miss how it would do arrays | |||
| vendethiel | newtype Arguments = [Expr]? :P | 19:55 | |
| I don't understand the diff. between "typed arrays" and your "array types" | 19:56 | ||
| masak | slight difference. "array types" are a part of my suggestions in github.com/masak/007/issues/32 -- they are core, and there's no relation to types as such. | 20:05 | |
| "typed arrays" would be something like `my a: Array<Q::Expr>;` | 20:06 | ||
| "array types" would be what would enable me to write `my args = Q::Arguments [...];` -- that is, an array constructor, but with a type in front of it. | |||
| and I see I've used "typed arrays" wrong once in the comment. retconning -- hold on. | 20:08 | ||
| done. | |||
| the problem with your proposed `newtype Arguments = [Expr]` is that the `[Expr]` syntax clashes with a proposed/conjectural type syntax that means "array of exactly one Expr element" | 20:09 | ||
| something like `Array where { .elems == 1 && .[0] ~~ Expr }` | 20:10 | ||
| vendethiel | ah, I see | 20:14 | |
| that was a ml/haskell-ish "'a list" or "[] a" | |||
| masak | nodnod | 20:15 | |
| I'm not sure I'll need the array syntax just to say [Foo, Bar, Baz] -- it's a bit too much like a tuple. | |||
| but I also think `[Expr]` doesn't *look* like it means `Array<Expr>` -- to me, it looks more like the thing with the `where` clause above :) | 20:16 | ||
| vendethiel | fair enough | 20:34 | |
| if [] means a tuple type | |||
| then probably, [] a = a? | |||
| :P | |||
| masak | they're certainly isomorphic to each other, if that's what you mean ;) | 20:43 | |
| I wouldn't call them the exact same type | |||
| that's Perl-think :P | |||
| nice -- I love the test suite. | 21:23 | ||
| I had \\" and \\\\ in strings unescape in the parser. one test unexpectedly started failing. | 21:24 | ||
| turns out it's correct to put in the string as-is in the Q::Literal::Str | |||
| it gets unescaped as it gets evaluated | |||
| why? because the Q::Literal::Str represents what it says in the code, and in the code there's still a backslash. | 21:25 | ||
| without that test failing, I totally would've committed the wrong fix. | |||