MasterDuke | so my source file+line number code breaks a couple tests. however, they are all tests that expect particular text in warnings/failures/etc (i.e., no functionality seems to be broken, just file names/line numbers change from what was previously expected) | 00:32 | |
additionally, it kind of has the same effect as always setting RAKUDO_BACKTRACE_SETTING=1 | 00:33 | ||
this seems to be because the filenames being reported are no longer 'gen/moar/m-CORE.setting', which a bunch of code in Backtrace.pm and/or Exception.pm check against | 00:34 | ||
so should i try and modify those checks to get the same effect? | 00:37 | ||
nqp: if "a1b2" ~~ /(.)/ { say("matched: " ~ $/[0]) } | 04:27 | ||
camelia | nqp-moarvm: OUTPUT«matched: » | ||
MasterDuke | ^^^ what am i doing wrong? | 04:41 | |
raiph | nqp: if "a1b2" ~~ /(.)/ -> $/ { say("matched: " ~ $/[0]) } # MasterDuke | 05:21 | |
camelia | nqp-moarvm: OUTPUT«matched: a» | ||
[Coke] and his bronchitis wave to everyone. | 05:22 | ||
MasterDuke | raiph: hot damn! many thanks, never would have figured that out | ||
raiph | [Coke]: that's not fun | 05:36 | |
[Coke] | raiph - nope. i have drugs, though, so all is well | 05:37 | |
raiph | [Coke]: heh | ||
raiph wonders if the drugs are enough to make the pun that's not a pun visible >.> | 05:39 | ||
timotimo | i think :16(*) should be short form for {:16($_)} rather than error out with "This call only converts base-16 strings to numbers; value * is of type Whatever, so cannot be converted" | 10:16 | |
lizmat | Files=1153, Tests=53734, 211 wallclock secs (12.67 usr 3.80 sys + 1287.42 cusr 122.35 csys = 1426.24 CPU) | 10:23 | |
timotimo | the thing is, that :16(*) is call &UNBASE, number, Whatever | ||
i don't think we have anything that'll make a call curried | 10:24 | ||
[TuxCM] | This is Rakudo version 2016.10-254-gd989d96 built on MoarVM version 2016.10-44-g4c9fd00 | 10:31 | |
csv-ip5xs 3.081 | |||
test 13.638 | |||
test-t 6.328 | |||
csv-parser 15.284 | |||
:) :) :) | |||
timotimo | good, good | ||
m: say (104, 105).chrs | 10:43 | ||
camelia | rakudo-moar d989d9: OUTPUT«hi» | ||
timotimo | m: say "104".chr | ||
camelia | rakudo-moar d989d9: OUTPUT«h» | ||
timotimo | m: say ("104", "105").chrs | ||
camelia | rakudo-moar d989d9: OUTPUT«Type check failed in converting element #0 to .chr; expected Int but got Str ("104") in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | 10:44 | |
timotimo | ^- this should work, right? | ||
maybe not for all of Cool, but it should definitely try for Int() | 10:54 | ||
lizmat | well, that function is on the edge between numbers and strings | 11:10 | |
timotimo | right. but here's where that came up: | 11:11 | |
lizmat | and personally I frequently mix up .ord and .chr | ||
as to whether it indicates what they take or what they return | |||
timotimo | m: say <<68 69>>.>>.base(16).>>.chr.join | ||
camelia | rakudo-moar d989d9: OUTPUT«,-» | ||
timotimo | m: say <<68 69>>.>>.base(8).>>.chr.join | ||
camelia | rakudo-moar d989d9: OUTPUT«hi» | ||
timotimo | m: say <<68 69>>.>>.base(8).chrs.join | ||
camelia | rakudo-moar d989d9: OUTPUT«Type check failed in converting element #0 to .chr; expected Int but got Str ("104") in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
TimToady | .tell viki andthen needs to return Empty on failure so that it works correctly in list comprehensions | 11:18 | |
yoleaux2 | 9 Nov 2016 14:46Z <viki> TimToady: could you give a ruling on whether andthen/notandthen should return Empty or the first undefined value? It creates a conflict with orelse/with either way and with needs to be rewritten without andthen: irclog.perlgeek.de/perl6-dev/2016-...i_13539174 | ||
TimToady: I'll pass your message to viki. | |||
TimToady | .tell viki The intent is that with also work right in list comprehensions, so there's no problem implementing with in terms of andthen | 11:19 | |
yoleaux2 | TimToady: I'll pass your message to viki. | ||
TimToady is more or less on vacation after Web Summit, but here I am anyway :) | 11:20 | ||
dalek | kudo/nom: 839c762 | lizmat++ | src/core/Shaped (2 files): Fix my @a[3;3]; $_ = $++ for @a The iterators for shaped arrays weren't containerizing unassigned values, so we couldn't assign values through the iterator. |
11:51 | |
lizmat | no spectests for this case :-( | ||
m: my @a[3;3]; $_ = $++ for @a | |||
camelia | rakudo-moar d989d9: OUTPUT«Cannot assign to an immutable value in block <unit> at <tmp> line 1» | ||
MasterDuke | lizmat: how important do think it is for the line number stuff i'm working on to exactly match the Perl 5 spec? | 11:54 | |
lizmat | well, it would be nice :-) | 11:55 | |
what part of the "perl 5 spec" is the problem ? | |||
(as there is just an implementation :-) | |||
MasterDuke | the regex used in Perl 5 is /^\# \s* line \s+ (\d+) \s* (?:\s("?)([^"]+)\g2)? \s* $/x | ||
using almost that exact same regex caused my nqp compile to take longer than overnight | 11:56 | ||
timotimo | well, that's easy | 11:57 | |
isn't (?: ... ) an optional group? | |||
viki | Hm. I need to think more about it then. 'cause I see notandthen returns Empty IF the item *is* defined. And then we have orelse that returns the $current item if it is defined.... But maybe that's OK and the bug I was trying to solve can be solved by just evaluating the thunk before returning it. | ||
yoleaux2 | 11:18Z <TimToady> viki: andthen needs to return Empty on failure so that it works correctly in list comprehensions | ||
11:19Z <TimToady> viki: The intent is that with also work right in list comprehensions, so there's no problem implementing with in terms of andthen | |||
lizmat | ^#line (\d+) (\S+) | ||
would work for me... | |||
timotimo | so you'd end up with \s* and \s* directly after each other | 11:58 | |
sorry, the ? after the group is what makes it optional, duh | |||
lizmat | I think we can just force a single space between the number and the rest | ||
MasterDuke | lizmat: that's much easier, i can do that with a combination of nqp::indexs and such | ||
lizmat | yeah, indeed... | ||
timotimo | why can't you parse the stuff out in the grammar already? | ||
MasterDuke | well, i'm currenty working in s/v/m/Q/QASTCompilerMAST.nqp | 12:00 | |
in compile_all_the_stmts() | |||
which is what calls HLL::Compiler.lineof | 12:01 | ||
timotimo | oh | ||
MasterDuke | and creates the annotation | ||
and i hadn't looked at the nqp grammar and how i would get info to compile_all_the_stmts() | 12:02 | ||
though, could i do something like you showed for rakudo? | 12:03 | ||
timotimo | i thought you were putting all the info into some data structure that you could just use in lineof | 12:05 | |
dalek | kudo/nom: 9a6ad43 | lizmat++ | src/core/Shaped (3 files): Make 123dimmed uninited elems assign a bit faster Not much, since you don't follow this path much anyway. |
12:06 | |
MasterDuke | this is what i have now: gist.github.com/MasterDuke17/ed414...3a337eb224 | 12:07 | |
and it does work | |||
timotimo | oh, are you trying to parse the whole target string for line number annotations each time a node's line number is required? | 12:10 | |
i was expecting there'd be a list of line numbers that correspond to file beginnings and then you just linear- or binary-scan through that | 12:11 | ||
consider how often that "annotate with line number if we have one" code gets called when compiling a file as big as the core setting | 12:12 | ||
MasterDuke | well, that's not happening at runtime, right? but yeah, when finding a line number for an annotation, i look backward from where we're figuring out the line number for that target string | ||
it seemed to add a couple seconds to the core compile | 12:13 | ||
timotimo | oh, what you meant by "over night" was when you used to have the regex instead of that | 12:14 | |
MasterDuke | sorry, yeah | ||
hmm, but why didn't i try to do what you showed at the rakudo level? | 12:16 | ||
i think i got distracted trying to figure out what was happening with lineno(), but i can see about doing it again at the nqp level | 12:18 | ||
timotimo | well, once you have the lineno, you can translate that | 12:19 | |
you'll end up needing a bit at the rakudo level and a bit at the MASTCompiler level, i think | 12:20 | ||
and it'd probably be nice to give this feature to the JVM, too | |||
MasterDuke | what at the rakudo level? the impression i got from jnthn was that he wanted the annotations in rakudo to already have the correct info | 12:23 | |
jnthn | Well, lineno is in HLL::Compiler iirc, which is shared between the backends | 12:24 | |
timotimo | oh, i don't think annotations exist at the rakudo level | ||
jnthn | I suspect we can do the mapping in there also. May be we need to tweak its API (and thus the backend code) so it returns a filename also since that's no longer global to the compilation unit | 12:25 | |
But "the backends call something in HLL::Compiler that gives them a line/file to use in the backend-specific way" - much like we do with just line numbers today - would seem sensible. | 12:26 | ||
MasterDuke | jnthn: so move what i added to s/v/m/Q/QASTCompilerMAST.nqp to HLL::Compiler.lineno()? | 12:28 | |
and instead change s/v/m/Q/QASTCompilerMAST.nqp to get a filename+linenumber from lineno() (and same for JVM)? | 12:29 | ||
dalek | kudo/nom: c541b3e | lizmat++ | src/core/List.pm: Simplify XX-Whatever role |
12:30 | |
jnthn | MasterDuke: Sounds reasonabler :) | 12:32 | |
lizmat | afk& | 14:14 | |
viki | Do we mark JVM... um... "issues" that require NFC stuff in any special way? I've got the preprocessor #?if jvm marker with a comment that we need proper Str.codes on JVM; do I need anything else? | 16:34 | |
I'll just re-title the ticket I'm fixing and will leave it open as a JVM one | 16:38 | ||
ZOFVM: Files=1202, Tests=130145, 147 wallclock secs (21.10 usr 3.54 sys + 2562.25 cusr 242.36 csys = 2829.25 CPU) | 16:45 | ||
dalek | rakudo/nom: d540fc8 | (Zoffix Znet)++ | src/core/Str.pm: | 16:52 | |
rakudo/nom: Fail when Str.Int numerics with combining characters | |||
rakudo/nom: | |||
rakudo/nom: Fixes RT#128542: rt.perl.org/Public/Bug/Display.html?id=128542 | |||
rakudo/nom: The proper-failing cases shown in the ticket fail() because in those conditions | |||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128542 | ||
dalek | rakudo/nom: Str.Int passes the handling to Str.Numeric. In the case with the issue, Str.Int | ||
rakudo/nom: takes a shortcut by checking if all characters are of Numeric class and then | |||
rakudo/nom: parsing it with radix. The issue happens due to combining characters getting | |||
rakudo/nom: the properties of their base char, so they end up being considered Numeric, bu | |||
rakudo/nom: nqp::radix stopping its parse on them, so we end up with partial parse of the | |||
rakudo/nom: number instead of any fail()ures. | |||
rakudo/nom: | |||
viki | github.com/rakudo/rakudo/commit/d5...88a26e6f77 | 16:53 | |
dalek | ast: 48d32a8 | (Zoffix Znet)++ | S32-str/numeric.t: Test .Int on strings with numerics with combining characters fails() RT#128542: rt.perl.org/Public/Bug/Display.html?id=128542 Fudged on JVM due to lack of proper Str.codes |
16:54 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128542 | ||
MasterDuke | anyone know why (some?) actions in rakudo and nqp are called twice? when i added a token for the #line directives, the corresponding action method is called twice | 17:01 | |
perlpilot | backtracking? | 17:06 | |
MasterDuke | dunno. FWIW, this is the token: ^^ '#' \s* 'line' \s+ $<line>=(\d+) \s* $<filename>=(\S+) $$ | 17:08 | |
viki | tokens don't backtrack | 17:17 | |
arnsholt | It'll still be called twice if there's something further up that backtracks | 17:28 | |
And possibly if there's lookahead | |||
FROGGS | no | 17:33 | |
actions are run after the rules/tokens have matched the entire text | 17:34 | ||
there is no action involved for lookaheads, and there also not for backtracking | |||
m: grammar G { token TOP { <?foo> <foo> }; token foo { abc } }; class A { method TOP ($/) { say 'TOP' }; method foo ($/) { say 'foo' } }; say G.parse('abc', :actions(A)) | 17:36 | ||
camelia | rakudo-moar d540fc: OUTPUT«foofooTOP「abc」 foo => 「abc」» | ||
FROGGS | weird | ||
why the heck do we do that? | 17:37 | ||
viki | What's <?foo> ? | ||
FROGGS | a lookahead | ||
m: grammar G { token TOP { <?foo> .+ }; token foo { abc } }; class A { method foo ($/) { say 'damn' } }; say G.parse('abc', :actions(A)) | 17:38 | ||
camelia | rakudo-moar d540fc: OUTPUT«damn「abc」» | ||
FROGGS | jnthn: is it correct that it prints 'damn' here? I was thinking that lookaheads are not supposed to result in action methods calls | ||
viki | FROGGS: and the actions are called as soon as the token is parsed, not when entire text gets parsed. | 17:39 | |
m: grammar { token TOP { <foo> \d+ }; token foo { a+ } }.parse("aaaa", :actions(class { method foo ($/) { say "foo" }})).say | 17:40 | ||
camelia | rakudo-moar d540fc: OUTPUT«fooNil» | ||
FROGGS | but why? | 17:41 | |
viki | Well, I guess for one, you don't have to keep all of that stuff around before you run it. | ||
... just to see whether you managed to parse the entire text | 17:42 | ||
FROGGS | on the other hand... we dont need to run the actions at all when the match failed | ||
viki | How would you figure out which action method to call when, when you're done parsing? | 17:43 | |
FROGGS | well, you run the action methods of the parsed tokens in reverse order | 17:44 | |
viki | What about all the dynamic variablesa? | ||
viki shrugs | |||
FROGGS | hmmmm | ||
point | |||
arnsholt | For one thing, later regexes can use information from previous AST objects to control what's matched | 17:45 | |
FROGGS | though, maybe we can at least do not call actions for lookaheads... maybe that's a sane request? | ||
would like to have jnthn's or TimToady's opinion on that now | |||
arnsholt | Not if you lookahead over something that introspects previous AST objects =) | ||
viki | m: grammar G { token TOP { <.?foo> <foo> }; token foo { abc } }; class A { method TOP ($/) { say 'TOP' }; method foo ($/) { say 'foo' } }; say G.parse('abc', :actions(A)) | 17:46 | |
arnsholt | Initially I thought that would be a reasonable optimization, but on further reflection I'm pretty sure it isn't | ||
camelia | rakudo-moar d540fc: OUTPUT«fooNil» | ||
FROGGS | you cannot access stuff from lookaheads anyway | ||
arnsholt | Sure, but *inside* the lookahead | 17:47 | |
FROGGS | yes, and then? | ||
viki | What's <.?foo> ? | ||
FROGGS | same as <?foo> | ||
viki | Fpm | ||
FROGGS | the dot just means "do not capture" | ||
viki | *Don't seem to be | ||
arnsholt | Consider "token foo" that does shenanigans involving the AST of rules called from it. Then <?foo> needs to build the AST, in order for foo to work | ||
viki | The parse fails. | ||
And if I tell it to parse "abcabc" succeeds | 17:48 | ||
FROGGS | m: grammar G { token TOP { <.?foo> <foo> }; token foo { abc } }; class A { method TOP ($/) { say 'TOP' }; method foo ($/) { say 'foo' } }; say G.parse('abcabc', :actions(A)) | ||
camelia | rakudo-moar d540fc: OUTPUT«foofooTOP「abcabc」 foo => 「abc」» | ||
FROGGS | m: grammar G { token TOP { <.)foo> <foo> }; token foo { abc } }; class A { method TOP ($/) { say 'TOP' }; method foo ($/) { say 'foo' } }; say G.parse('abcabc', :actions(A)) | ||
camelia | rakudo-moar d540fc: OUTPUT«===SORRY!===Unrecognized regex metacharacter < (must be quoted to match literally)at <tmp>:1------> grammar G { token TOP { <.⏏)foo> <foo> }; token foo { abc } }; clasUnrecognized regex metacharacter . (must be quoted to match li…» | ||
FROGGS | m: grammar G { token TOP { <.^foo> <foo> }; token foo { abc } }; class A { method TOP ($/) { say 'TOP' }; method foo ($/) { say 'foo' } }; say G.parse('abcabc', :actions(A)) | ||
camelia | rakudo-moar d540fc: OUTPUT«===SORRY!===Unrecognized regex metacharacter < (must be quoted to match literally)at <tmp>:1------> grammar G { token TOP { <.⏏^foo> <foo> }; token foo { abc } }; clasUnrecognized regex metacharacter . (must be quoted to match li…» | ||
FROGGS | I dunno | 17:49 | |
arnsholt: that sounds horrible :P | |||
arnsholt | FROGGS: Clearly, it's *perverse*! | 17:50 | |
FROGGS | *g* | ||
arnsholt | But it's possible, so we can't optimise out actions =) | ||
dalek | kudo/nom: 6057295 | lizmat++ | src/core/List.pm: Streamline xx * a bit further |
17:51 | |
jnthn | FROGGS: Yes, it's correct that it calls action methods on things that are later "unused" | 18:06 | |
They're called bottom-up | |||
masak | I guess such things could be optimized away only to the extent the AST result could be shown never to be used. | 18:18 | |
which is quite hard, at a guess. | 18:19 | ||
dalek | kudo/nom: dcfd4ed | lizmat++ | src/core/Shaped (3 files): Streamline 123dimmed AT-POS Also get back the performance loss of 839c7620a63970480 on 1dimmed iterator |
18:20 | |
FROGGS | jnthn: and that's also true for things like lookaheads? | 18:51 | |
jnthn: I mean, you cannot access what it has made anyway | |||
what if we alter the world in a lookahead? | 18:53 | ||
the stuff we make there wont make it into the ast | |||
FROGGS .oO( maybe this saves us an entire microsecond in stage parse! ) | 18:55 | ||
TimToady | one could conceivably have a lazy make that only triggers when forced to | 19:18 | |
timotimo | did i actually end up pushing the ords fix ... | 19:27 | |
dalek | kudo/nom: 4ae3f23 | timotimo++ | src/core/Str.pm: let chrs also work with numbers that are in Str form |
19:29 | |
timotimo | woop, there it is. | ||
seems like i wanted to add tests, but didn't, so i also didn't push the fix itself | |||
dalek | ast: aff9733 | timotimo++ | S29-conversions/ord_and_chr.t: test chrs on list of numifiable strings |
19:32 | |
MasterDuke | so it's expected that tokens with lookaheads will call their action twice, but why does mine even though there are no lookaheads? | 19:35 | |
FROGGS | MasterDuke: is there a lookahead around that somewhere? | 19:39 | |
MasterDuke | it's in the top level of HLL::Grammar | 19:40 | |
FROGGS | MasterDuke: is it in branch or fork? | 19:52 | |
I dont spot it in my nqp | |||
MasterDuke | FROGGS: gist.github.com/MasterDuke17/c1d54...8700dde223 | 19:55 | |
lizmat | m: say Hash ~~ Iterable; say QuantHash ~~ Iterable # shouldn't these be both True ? | ||
camelia | rakudo-moar 4ae3f2: OUTPUT«TrueFalse» | ||
MasterDuke | all local work so far, haven't pushed anything anywhere yet | 19:56 | |
masak | lizmat: Hash is Map, which does both Iterable and Associative. QuantHash on the other hand does Associative directly. | 20:00 | |
FROGGS | MasterDuke: there is nothing in your gist that refers to the line_directive token in a grammar | ||
MasterDuke: how is it called at all? | |||
masak | lizmat: without looking deeply into it, my guess is that QuantHash ought to is Map, just like Hash. | ||
("ought to is" -- Perl 6 makes me grammar badly) | 20:01 | ||
lizmat | well, that's the thing: QuantHash is a role, just like Associative | ||
masak | just realized | ||
lizmat | at least in practice now, and in specs also | ||
viki | m: my @h = bag 1, 2, 3; dd @h | 20:02 | |
camelia | rakudo-moar 4ae3f2: OUTPUT«Array @h = [(3=>1,1=>1,2=>1).Bag]» | ||
MasterDuke | FROGGS: dunno, how are any of the tokens in HLL::Grammar called? | ||
viki | use MONKEY; augment class Bag does Iterable {}; my @h = bag 1, 2, 3; dd @h | ||
m: use MONKEY; augment class Bag does Iterable {}; my @h = bag 1, 2, 3; dd @h | |||
camelia | rakudo-moar 4ae3f2: OUTPUT«Array @h = [3 => 1, 1 => 1, 2 => 1]» | ||
viki | Hm, seems like the change would be quite big if we add it? | ||
masak | lizmat: I see Setty does QuantHash | ||
Setty is also a role | |||
are there arguments for or against Setty doing Iterative? | |||
er, Iterable | 20:03 | ||
m: say Set ~~ Iterable | |||
camelia | rakudo-moar 4ae3f2: OUTPUT«False» | ||
lizmat | the reason I ran into this, is that I wanted to make a fast ItemIterator | ||
one that only ever produces 1 value, etc | |||
and have Any.iterator refer to that | |||
FROGGS | MasterDuke: like this: | ||
nqp/src/HLL/Grammar.nqp:76: token dec_number { | |||
nqp/src/NQP/Grammar.nqp:667: [ <dec_number> | <integer> ] | |||
NQP::Grammar makes use of the stuff in HLL::Grammar | 20:04 | ||
MasterDuke: do you have a modified rakudo too by any chance? | |||
lizmat | masak: never mind, I think I got a way around it | 20:05 | |
MasterDuke | nope, not (yet) for this | ||
masak | lizmat: it is an interesting question though. are Sets (supposed to be) Iterable? | 20:07 | |
lizmat | fwiw, I thought they always were | 20:08 | |
now I realize that Set.values is actually implemented without an iterator method | |||
actually, whatever Set.list does | 20:09 | ||
which is .pairs.cache for some reason | 20:10 | ||
m: for <a b c>.Bag { dd $_ } # hmmmm | 20:11 | ||
camelia | rakudo-moar 4ae3f2: OUTPUT«:a(1):c(1):b(1)» | ||
lizmat | m: for <a b c>.Set { dd $_ } # hmmmm | 20:12 | |
camelia | rakudo-moar 4ae3f2: OUTPUT«:a:c:b» | ||
viki | m: for (:a, :b:, :c).Hash { dd $_ } | 20:13 | |
camelia | rakudo-moar 4ae3f2: OUTPUT«===SORRY!=== Error while compiling <tmp>Confusedat <tmp>:1------> for (:a, :b:⏏, :c).Hash { dd $_ } expecting any of: colon pair» | ||
viki | m: for (:a, :b, :c).Hash { dd $_ } | ||
camelia | rakudo-moar 4ae3f2: OUTPUT«:a:c:b» | ||
FROGGS | MasterDuke: I've applied your patch, added a nqp::say statement to the line_directive action method and run this example: | 20:14 | |
$ perl6 -e '# line 45 foo.txt' | |||
I dont see anything printed... | |||
lizmat | FROGGS: shouldn't that be #line without space ? | 20:15 | |
FROGGS | to me it looks like the line_directive token is not used | ||
lizmat: space is allowed | |||
same without whitespace fwiw | |||
MasterDuke | FROGGS: i saw a say in the action get printed twice when compiling rakudo | ||
FROGGS | I didnt | 20:16 | |
MasterDuke: where is your say statement? | |||
MasterDuke | hmm, something is odd. now a say (printfh really) in the action doesn't print. i may actually have been on a modified rakudo (where i added a token/action with the same name) | 20:20 | |
but, it was definitly using the printfh in the nqp action method | 20:21 | ||
viki | So, we're cool with "FF".format-base(16) -> 255 ? | 20:23 | |
Oh waity | |||
So, we're cool with "FF".parse-base(16) -> 255 ? | |||
irclog.perlgeek.de/perl6/2016-11-11#i_13550787 | |||
That's not a good start when I confuse them already :P | |||
lizmat | yeah, that's really the issue with all of these :-( | 20:24 | |
m: role A { has $.a }; my $a = 42 but A(666); say $a.a # huh? How does 666 wind up in there ? | 20:28 | ||
camelia | rakudo-moar 4ae3f2: OUTPUT«666» | ||
lizmat | is this some DWIMmery? | 20:29 | |
viki | m: role A { has $.a }; my $a = "x" but A(666); say $a.a | ||
camelia | rakudo-moar 4ae3f2: OUTPUT«666» | ||
viki | 0.o | ||
geekosaur | m: role A { has $.b; }; my $a = "x" but A(666); say $a.a | 20:30 | |
camelia | rakudo-moar 4ae3f2: OUTPUT«No such method 'a' for invocant of type 'Str+{A}' in block <unit> at <tmp> line 1» | ||
geekosaur | whoops | ||
anyway it;s conflating them | 20:31 | ||
m: role A { has $.b; }; my $a = "x" but A(666); say $a | |||
camelia | rakudo-moar 4ae3f2: OUTPUT«x» | ||
lizmat | github.com/rakudo/rakudo/blob/nom/...or.pm#L467 # is what me set on this | ||
moritz | yes, there's extra magic for initalizing roles with a single attribute | ||
lizmat | TIL :-) | 20:32 | |
geekosaur | but mine had a single attribute too | ||
moritz | but you did't access it | ||
lizmat | geekosaur: but you used the wrong accessor | ||
FROGGS | m: role A { has $.b; }; my $a = "x" but A(666); say $a.b | ||
camelia | rakudo-moar 4ae3f2: OUTPUT«666» | ||
geekosaur | the first one didn't have an accessor | ||
my corrected one also didn't have an accessor (I grabbed the wrong one from where viki was trying to figure out what happened the first time) | 20:33 | ||
oh, gm, sorry, guess it did | |||
misread it the first time :/ | |||
MasterDuke | FROGGS: figured it out, changing the token and action name to comment:sym<line_directive> makes it work | 20:36 | |
you caught me in the middle of some renaming when i made the gist | 20:37 | ||
makes it work = the printfh() in the action happens twice when compiling rakudo | 20:38 | ||
viki | m: say :16("0.FF") | 20:39 | |
camelia | rakudo-moar 4ae3f2: OUTPUT«0.996094» | ||
viki | m: say :16(".FF") | 20:40 | |
camelia | rakudo-moar 4ae3f2: OUTPUT«Cannot convert string to number: base-16 number must begin with valid digits or '.' in ':16<⏏.FF>' (indicated by ⏏) in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
viki | I'm failing to think of a clean way of doing .parse-base | 20:42 | |
Considering stuff like this works: :16("F.Fe10") | |||
So the shortest thing is to use ":$radix\<$num>" under the hood and to somehow relay errors, which is gross :) | |||
masak | viki: well, what does ":$radix\<$num>" use? | 20:44 | |
FROGGS | MasterDuke: I get this: | 20:45 | |
Stage parse : #line 1 src/core/core_prologue.pm | |||
Cannot find method 'add_comp_files_to_directives' on object of type Perl6::World | |||
at gen/moar/stage2/NQPHLL.nqp:1250 (/home/froggs/dev/nqp/install/share/nqp/lib/NQPHLL.moarvm:comment:sym<line_directive>) | |||
but, I need some sleep... | |||
gnight #perl6* | |||
lizmat | FROGGS: good night! | ||
viki | masak: grammar | 20:46 | |
MasterDuke | .tell FROGGS sorry, another renaming thing, 'add_comp_files_to_directives' should be 'add_comp_lines_to_directives' | ||
yoleaux2 | MasterDuke: I'll pass your message to FROGGS. | ||
viki | Well, I see it dump "radix" when I target==parse it, but I don't see that token in grammr | 20:47 | |
MasterDuke | ugh, no list/array sort in nqp? | ||
viki: i think it's rad_num | 20:48 | ||
viki | Will take a look on Monday. Gotta finish work stuff and then it's a Warframe Weekend Marathon for me | ||
\o | |||
dalek | kudo/nom: a43b0c1 | (Vladimir Marek)++ | Configure.pl: Solaris needs to use gnu make instead of /usr/bin/make |
21:52 | |
kudo/nom: fc6d4f3 | lizmat++ | Configure.pl: Merge pull request #917 from vlmarek/nom Solaris needs to use gnu make instead of /usr/bin/make |