Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2016-01-11

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:31 vendethiel joined #6macros
01:03 vendethiel joined #6macros
02:49 ilbot3 joined #6macros
04:08 vendethiel joined #6macros
07:44 FROGGS joined #6macros
08:59 vendethiel joined #6macros
09:51 vendethiel joined #6macros
10:36 vendethiel joined #6macros
10:59 vendethiel joined #6macros
11:21 andreoss joined #6macros
11:25 andreoss masak: Regarding turning some builtins to methods. Should such method calls be interpreted as a routine stored inside class/type called with `self` as a first argument?
11:25 andreoss 10.abs() === Int.abs(10)
11:33 andreoss s/method calls/methods/
12:07 masak no, I don't think so
12:07 masak that seems like mixing up two things
12:08 masak in 007, Val::Type is a different class than Val::Int, with different methods
12:08 masak by the way, I started on the builtins-to-methods thing yesterday, but didn't get all that far
12:09 masak I only split up the t/features/builtins/subs.t into subs.t and methods.t
12:09 masak next up would be to change all the ASTs in methods.t
12:25 andreoss masak: basically I wanted to refactor these builtins to Val::Method::Builtin and make them elements of %.properties of each type
12:27 vendethiel joined #6macros
12:35 masak Val::Method::Builtin sounds wrong :)
12:36 masak mostly because every instance of a Val:: type tends to correspond to a value in userland
12:42 vendethiel- joined #6macros
12:54 ilbot3 joined #6macros
13:08 vendethiel joined #6macros
13:25 andreoss masak: Val::Sub::Builtin doesn't count?
13:27 andreoss Val::Method::Builtin would be almost the same class
13:58 vendethiel joined #6macros
14:46 vendethiel joined #6macros
14:54 masak oh, now I see what you want to do
14:54 masak yeah, maybe...
14:54 masak though methods don't properly exist in 007 separately from subs, so it still feels odd
15:32 andreoss ok
15:34 andreoss so Python-style type class would be wrong completely. Int would become an object, and all unresolved property look-ups would be delegated to it
15:35 andreoss The way with Val::Method seems to easy.
15:36 masak there's a `method property` in Runtime.pm
15:36 masak I imagined most of the methods would end up there
15:37 masak note that the methods that are already there are normal Val::Sub
15:37 masak nope, sorry, they're Val::Sub::Builtin
15:38 masak if we feel that `method property` ends up being a general dump for things, we might think of a way to structure it a bit better and/or move those methods to Builtins.pm
15:40 andreoss masak: Val::Sub::Builtin is a special case
15:40 andreoss isn't it?
15:41 andreoss i see `multi method call(Val::Sub::Builtin ...`
15:46 andreoss ok. i see now how it works with `method propery`
15:47 Ven joined #6macros
15:48 masak yes, it's a special case, because we need to call it in a different way.
15:49 masak I'm hoping at some point we'll get rid of Val::Sub::Builtin completely.
15:49 masak which is why I moved it from Q.pm into Builtins.pm
15:49 Ven o/
15:50 vendethiel joined #6macros
15:50 andreoss perl6 -Ilib bin/007 -e= 'my a = { b: 10 }; say(a.has("b"))'
15:50 andreoss should this work?
15:51 masak yes, I think it should.
15:51 masak ...and it does. phew :)
15:52 masak it's more interesting what this would do: `my a = 42; say(a.has("abs"))`
15:52 masak I think that should work, too (doesn't currently)
15:53 masak Int and the other "primitive" types in 007 aren't object types... but that doesn't stop them from having a bit of object nature, such as having properties
15:54 andreoss the space after = wasn't necesary
15:55 andreoss also why not a.^has("a")?
15:55 masak oh, I didn't even see that
15:56 andreoss isn't .has a meta-method here?
15:56 masak andreoss: that's a good point
15:56 masak in this case, we sort of conflate those things
15:56 masak but... the problem is that in all cases *except* Object, you can ask the type instead of the instance
15:56 masak with Object, every object is different
15:57 masak I think the same argument could be made about `a.get("b")`
15:58 masak anyway, for now they will stay on the object. it may not be super-correct, but it's pretty simple.
15:58 masak I will keep it in mind, though.
15:59 masak andreoss++ sergot++ # implementing all the operators in #57
15:59 masak hanoi.007 is starting to look pretty good now ;)
15:59 andreoss infix:<~~> is yet to go
16:00 masak sergot++ implemented it today
16:01 andreoss okay, i was about to propose renaming it to infix:<is>
16:04 andreoss for python-ish resemblence
16:07 masak but Python's `is` does reference comparison, not type matching
16:11 andreoss a is None would still work
16:14 masak yes, but we already have that functionality through infix:<==>
16:14 masak and nothing else would work the same with infix:<~~>
16:28 andreoss left #6macros
16:31 vendethiel joined #6macros
16:54 vendethiel joined #6macros
17:19 vendethiel joined #6macros
18:07 vendethiel joined #6macros
19:01 vendethiel joined #6macros

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary