|
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:48
ilbot3 joined
04:16
vendethiel joined
06:47
Ven joined
06:54
Ven_ joined
07:11
Ven joined
07:14
FROGGS joined
07:21
Ven_ joined
08:50
Ven joined
11:12
Ven joined
11:56
Ven joined
|
|||
| Ven | masak: wanted to ask – what do you think about dynamically scoped variables in perl 6? | 12:25 | |
| I Think we talked about this a bit at SPW | |||
| masak | I kind of like them. I don't use them a lot. | 12:30 | |
| I find them a bit hard to use. not technically, but the code gets harder to understand from them. | 12:31 | ||
| I think what finally won me over to contextual variables was TimToady's (offhand) comment that when you're a parser, the things that are lexically scoped at runtime tend to be dynamically scoped at parse time | 12:32 | ||
| that's just like... whoa | |||
| Ven | oh, that's interesting | 12:33 | |
| I have a problem with them | |||
| the name is unscoped. | |||
| masak | yes. | 12:40 | |
| I've thought of that sometimes. | |||
| they don't buy into any namespace mechanism at all. | |||
| Ven | I think scheme/racket/clojure's solution | ||
| where the name is statically scoped (to packages), but the value itself is dynscoped | 12:41 | ||
| is much, much, much better, and actually scalable | |||
| masak | that makes sense, yes. | ||
| Ven | (binding ((foo-bar/debug true)) (foo-bar/do-stuff)) | 12:42 | |
| I don't really like Perl 6's module system... | |||
| I don't like flattening, I don't like modules, and I don't like a[0] =:= a unless Positional | 12:43 | ||
| that's pretty much the "less awesome" features in *my* list | |||
| mmh. | 12:45 | ||
| I don't think I can push the namespaced-dynamics issue though | 12:46 | ||
| it seems to be too late | |||
| masak | yeah | 13:02 | |
| though I guess you could provide a safer variant as a module :) | |||
| Ven | that'd be very hard, though | 13:04 | |
| masak | Ven: I'm curious what you think about the design of github.com/masak/007/issues/30 | 13:15 | |
| (as a way to get back to the topic, ish, of the channel) :) | |||
| Ven reads up | |||
| I like it | 13:16 | ||
| as I said, I'm not sure if {{{Q::Infix: foo}} or the other way around would be the est | |||
| best* | |||
| I also thought about using `@`, reminescent of as-patterns | 13:17 | ||
| masak | could you show that as an entire chunk of syntax? | 13:19 | |
| re which way around: I find them to be equally good, so I chose {{{foo: Q::Infix}}} for strange consistency with type annotations | 13:20 | ||
| (which these are not, but might as well look like) | 13:21 | ||
|
14:12
Ven joined
|
|||
| Ven | foo MyStruct(a, b, c)@x = ... | 14:13 | |
| masak | what does the `foo` do in that example? | 14:14 | |
| Ven | it's the name of the function | 14:23 | |
| "add (a, b) = a + b" | 14:24 | ||
| ml style function definition | |||
| as-pattern allows destructuring while keeping the original value | |||
| masak | ah, ok | ||
| well, the unquote is not really a definition site. it's a usage site. | 14:25 | ||
| Ven | that I agree with | ||
| I meant more like, "TypeName()@BoundVariable" look | 14:26 | ||
| masak | does Haskell (or others) use `@` on the call side? I've only seen it in definitions, I think... | 14:31 | |
| Ven | no | 14:48 | |
|
15:16
FROGGS joined
|
|||
| masak | then I don't think it's all that applicable, and I still like the type annotation-like syntax more :) | 15:25 | |
| stray idea: maybe macro invocations inside quasis shouldn't expand until splice time | 15:26 | ||
| in fact, an argument could be made that they *can't* trigger before that (since the macro arguments may contain unquotes) | 15:27 | ||
| huh. dunno why that hasn't been obvious to me before. | |||
| anyway, that makes macros a whole lot more powerful, I think. means you can recurse them, as long as you do it inside quasis. | |||
| I'm about to get on a long-haul flight, so I won't be so communicative for the next 36 h or so. | 15:56 | ||
|
16:18
Ven joined
|
|||
| Ven | I just think the colon is overused, again | 16:21 | |