The topic for #perl6 is: pugscode.org/ planetsix.perl.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/
Set by TimToady on 25 November 2008.
mncharity pmurias: in fact, on possible path into running STD.pm, instead of EXPR-first, or top-down statements, would be p5 re first. that would let us run the test suite faster (30s/1min/1hr original/current/elf-and-STD_blue), provide the first reality check on rx_on_re performance vis running STD, and set up to perhaps do p6 rx next, where it could be nice to 00:03
have a fast edit-test cycle heading into the rest of STD.pm.
s/on possible/one possible/
pmurias was afk 00:07
mncharity has a tablet now... have to remember to use afk as a joke somewhere... 00:08
pmurias ruoso: hi 00:09
ruoso hi pmurias
pmurias mncharity: the problem with the plan is that p5 re aren't good enough to base running STD.pm on them 00:10
s/the/that 00:11
pmurias ruoso: re c project topic what other C tasks do we have in smop? 00:12
other than PCL 00:16
mncharity pmurias: re the problem, err, there are a great many things which aren't good enough to base a running STD.pm on. STD.pm is very not-small and non-trival. so the task is to identify subsets of it which can be developed and tested well. core IR and runtime regex/regexp is one such.
one alternate approach being start from scratch, banging STD against t/ . been there, done that several times, not a fun place to be. 00:18
much nicer to be able to say after each edit / refactoring, "and a big portion of everything still works". 00:19
pmurias banding STD against t/ being using STD to run a random subset of t/ 00:20
s/banding/banging 00:21
?
mncharity the rx_on_re work, while spread over a couple of months, has probably only been a few FT days of work. test-based keep-it-working development tends to be vastly faster than 'extend and debug'. re banging,
pmurias shower& 00:23
mncharity pugs, the pugs alternate backends, redsix, kp6, all took "now we parse file one of t/sanity, now file two, now...". could do the same thing with STD. but once something... ah ok. another time. 00:24
literary license on the last paragraph. creation of t/01-sanity was actually a nice improvement. 00:27
I'm off. if not back in next few days, happy holidays all. 00:29
pugs_svn r24506 | lwall++ | [S19] random annotations for [particle]++'s consideration 02:06
slavik rakudo: say "hello" 02:12
p6eval rakudo 34122: OUTPUT[hello␤]
meppl good night 02:47
pugs_svn r24507 | pmichaud++ | [t/spec]: Update main.t test to work with fudging. 03:19
rakudo_svn r34128 | util++ | [codingstd] Removed trailing whitespace from action.pm 03:20
slavik @tell slavik hello 03:36
lambdabot You can tell yourself!
pugs_svn r24508 | wayland++ | Added some definitions 03:44
pasteling "mncharity" at 98.216.110.149 pasted "STD.pm/gimme5 unexpected p5 re parse failures" (255 lines, 5.8K) at sial.org/pbot/33935 04:44
cspencer rakudo: (1..4).map: { .say } 04:51
p6eval rakudo 34129: OUTPUT[Method 'map' not found for invocant of class 'Range'␤current instr.: '_block14' pc 82 (EVAL_16:43)␤]
slavik rakudo: map { say } 1..4; 04:53
p6eval rakudo 34129: OUTPUT[Statement not terminated properly at line 1, near "1..4;"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
slavik rakudo: map { say } 1..4
p6eval rakudo 34129: OUTPUT[Statement not terminated properly at line 1, near "1..4"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
slavik rakudo: map { say $_ } 1..4;
TimToady @tell mncharity thanks for the p5regex nopaste
p6eval rakudo 34129: OUTPUT[Statement not terminated properly at line 1, near "1..4;"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
lambdabot Consider it noted.
slavik hmm
cspencer rakudo: (1..4).grep: { $^a % 2 } 04:54
p6eval rakudo 34129: OUTPUT[Method 'grep' not found for invocant of class 'Range'␤current instr.: '_block14' pc 82 (EVAL_16:43)␤]
slavik for 1..4 { say };
rakudo: for 1..4 { say };
p6eval rakudo 34129: OUTPUT[␤␤␤␤] 04:55
slavik rakudo: for 1..4 { say $_ };
p6eval rakudo 34129: OUTPUT[1␤2␤3␤4␤]
slavik map 1..4 { say $_ };
rakudo: map 1..4 { say $_ };
p6eval rakudo 34129: OUTPUT[Statement not terminated properly at line 1, near "{ say $_ }"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
slavik map is broken?
TimToady the block of map needs a comma after the block 04:56
cspencer rakudo: my @list = (1..4); @list.map: { .say }
TimToady rakudo: map { .say }, 1..4
p6eval rakudo 34129: OUTPUT[1␤2␤3␤4␤]
slavik oh, not like Perl5, eh?
heh
cspencer it's broken for Range's, i was just working on a patch for that
slavik oh 04:57
cspencer (if that's what had got you wondering...)
TimToady yes, there is no indirect object syntactic slot like there is in p5
cspencer o
er
slavik rakudo: map { say }, 1..4
p6eval rakudo 34129: OUTPUT[␤␤␤␤]
TimToady and nothing defaults to $_
slavik say doesn't act on $_ by default?
err, how come?
TimToady to throw out one of the lists of exceptions that people had to memorize
it's not that much harder to say .say 04:58
cspencer sorry, don't mind my "er" :)
slavik TimToady: not arguing, just learning, heh
cspencer i'm assuming map should also work on something like: (1..4).map: { .say } ?
TimToady you don't have to know that certain vars are the same var in every package anymore either
rakudo: [1..4].map: { .say } 04:59
p6eval rakudo 34129: OUTPUT[1␤2␤3␤4␤]
TimToady it's just that Range objects aren't sufficiently listlike yet
cspencer i'll send in a patch for that shortly
slavik TimToady: will parrot/perl6 be ported to symbian by any chance?
TimToady map should probably be coming out of some kind of Traversible role
slavik would be nice to have perl6/python/others available on symbian as an alternative to Java 05:00
TimToady I'm not familiar with symbian, so you'd have to ask the parrot folks
slavik k
TimToady what is symbian?
slavik TimToady: OS for mobile phones 05:01
cspencer TimToday: ah ok, i'd moved map/grep into the 'Any' class, is that incorrect?
slavik like windows mobile, but better ;)
and they have POSIX ported to it and a C++ compiler
so, gcc can compile for symbian
slavik it's also usually an ARM CPU 05:01
TimToady Any is okay for now 05:03
cspencer ok
TimToady but that doesn't explain why Range couldn't find it...
or is that not checked in yet? 05:04
cspencer not checked in yet no 05:06
Range couldn't find it because map/grep was in the List class
so i'd moved it into Any, which both List/Range derive from
the patch is in ticket #61550 05:07
TimToady but eventually it probably wants to be abstracted into some kind of a role for anything traversible 05:08
cspencer alrighty
TimToady which might or might not be the same as a List role
course if anything not traversible is its own list of one element, then maybe Any is appropriate 05:09
cspencer are hashes traversable?
TimToady I think the basic question is, what does this look like in list context? 05:10
cspencer right, ok
TimToady so certainly hashes work
it might also be closely related to the Iterator interface 05:11
azawawi hi 05:53
TimToady: thx; i will test right now.
azawawi std: my $bar = "&<>"; 06:25
p6eval std 24508: OUTPUT[00:07 88m␤]
azawawi TimToady: ping 06:30
@tell TimToady it works but it introduces another bug in my tests; see 'cd ~/pugs/misc/Syntax-Highlight-Perl6; make test'. First call to STD->parse works but subsequent calls fail on new text. 06:32
lambdabot Consider it noted.
slavik azawawi: what are you working on?
azawawi slavik: Perl6 syntax highlighting and Padre 06:33
slavik using grammars?
azawawi no using perl5 code
slavik I see
where is this syntax highliting used?
azawawi offline generation of t/spec: feather.perl6.nl/~azawawi/html/ 06:34
and in Padre::Plugin::Perl6
soon to be released
slavik javascript? 06:35
there should be a text editor in Perl6, where highlighting is done with grammars ...
seems like a good idea to me (as long as you have a grammar for a language and know what colors what piece of the language has to be) ... 06:36
azawawi nice idea... go for it
slavik :-\
are there gtk bindings for perl6 yet though?
pugs_svn r24509 | azawawi++ | [Syntax::Highlight::Perl6] Fix localization of "context" vars such as $::PARSER;
r24509 | azawawi++ | [Syntax::Highlight::Perl6] TimToady++
Minthe Excuse me, but can I build pugs-r24509 with GHC682 successfully? 06:37
slavik not only that, but I have never build a text editor ... :( 06:38
pugs_svn r24510 | azawawi++ | [Syntax::Highlight::Perl6] $VERSION is now '0.0296' 06:39
r24510 | azawawi++ | [Syntax::Highlight::Perl6] Removed all extra references to use STD
r24510 | azawawi++ | [Syntax::Highlight::Perl6] Updated changes and pod bugs section
r24510 | azawawi++ | [Syntax::Highlight::Perl6] Not going to release this to CPAN since make test fails
slavik Minthe: looks like your pugs version just got outdated ...
azawawi minthe: if you want to try 'pugs' quickly use this: 06:40
pugs: say 'hello';
Minthe I use pugs-r19955, the final version which can be built with GHC661
p6eval pugs: OUTPUT[hello␤]
slavik Version: 6.2.13.11 06:49
the pugs I have came from the cabal packages
and I use rakudo
it seems to have more stuff 06:50
Minthe So I'd like to ask you whether the latest version built with GHC682 works without errors? 07:08
slavik no idea
Minthe s/\?/\./
slavik I installed the pre-compiled version from cabal
azawawi minthe: let me check
minthe: i have 6.8.2 on feather1 07:09
minthe: and i compiled it before so it should work
Minthe Thank you 07:11
So the bug I talked about in irclog.perlgeek.de/out.pl?channel=p...2008-06-05 was fixed. 07:12
azawawi no idea there
minthe: pugs has slept for 3 years now ;-) 07:14
Minthe r21xxx showed "Invalid grammatical category: "Bool""
slavik same here 07:39
pugs_svn r24511 | azawawi++ | [Cursor.pmc] Fixed the log file creation even though debug is not enabled 07:47
r24511 | azawawi++ | [Cursor.pmc] STD5DEBUG could be q{} and hence added a check to make it zero
pugs_svn r24512 | azawawi++ | [Syntax::Highlight::Perl6] Fixed the log file creation even though debug is disabled 07:52
r24512 | azawawi++ | [Syntax::Highlight::Perl6] Updated the BUGS sections
Minthe Oh now Pugs builds dependencies automatically 09:45
Very nice.
Minthe In r19955 I had to manually install parsec and so on. 09:46
moritz_ aye 09:47
Minthe Dependencies built. Proceeding to make core... 09:56
pugs_svn r24513 | moritz++ | [t/spec] test for .grep on Range, and unfudge Range.map test 10:14
rakudo_svn r34133 | moritz++ | [rakudo] move .map and .grep to any-list.pir to make them work on ranges. 10:20
r34133 | moritz++ | Patch courtesy by Cory Spence, cspencer++. Closes RT #61550.
azawawi hi moritz 10:27
pasteling "azawawi" at 212.38.154.37 pasted "make test output" (34 lines, 1.5K) at sial.org/pbot/33937 10:29
pugs_svn r24514 | moritz++ | [t/spec] clean up a test that depended on hash order 10:45
moritz_ I'll mostly be offline until 2009-01-08 10:48
pmichaud :( 10:49
I hope it's for a good vacation, though.
rakudo_svn r34134 | pmichaud++ | [rakudo]: spectest-progress.csv update: 252 files, 5228 passing, 0 failing 10:50
pmurias ruoso: spec/S02-builtin_data_types/autovivification.t is enough for correct autovivification? 10:56
rakudo_svn r34135 | pmichaud++ | [rakudo]: Clean up export handling for 'map' and 'grep'. 11:00
moritz_ pmichaud: I'm a bit confused, why does it work without export? it gave me some test failures when I tried without 11:03
pmichaud the functional forms currently go into the [] namespace.
the original patch didn't have that. 11:04
moritz_ ah
pmichaud stated differently: the method form goes into 'Any', the subroutine form goes into []
then, if the method is "is export" in S29, we use !EXPORT
moritz_ so [] basically is our prelude scope?
pmichaud technically in Parrot it's global scope, but yes, we're using that for prelude scope for now until we get a true prelude scope. 11:05
pmichaud or, perhaps [] will always be our prelude scope, and we'll use ['GLOBAL'] for our global scope. 11:05
haven't worked that out yet.
rakudo_svn r34137 | pmichaud++ | [rakudo]: Distinguish array from hash access (resolves RT #60732). 11:20
moritz_ pmichaud: do we have tests for #60732? 11:23
pmichaud one test, yes. 11:24
pmichaud unfudging it now. 11:25
azawawi this 'akl-' guy is getting on my nerve
or bot
pmichaud anyone have chanops? 11:26
azawawi what? ;-)
moritz_ here? diakopter or TimToady ususally
pugs_svn r24515 | pmichaud++ | [t/spec]: Unfudge test resolved in RT #60732. 11:27
azawawi Padre::Plugin::Perl6 0.01 is out on CPAN
moritz_ rt is behaving badly 11:29
pugs_svn r24516 | moritz++ | [t/spec] tests for RT #61544 11:31
moritz_ is "\x[41]" still valid interpolation syntax? 11:40
pmichaud yes, as far as I know. 11:41
rakudo: say "\x[41]"
p6eval rakudo 34137: OUTPUT[A␤]
pmichaud rakudo: say "\x[48,101,108,108,111]"
p6eval rakudo 34137: OUTPUT[HāĈĈđ␤]
pmichaud oh.
rakudo: say "\x[48,65,6c,6c,6f]" 11:42
p6eval rakudo 34137: OUTPUT[Hello␤]
pugs_svn r24517 | moritz++ | [t] move interpolation/strings.t to spec/
moritz_ rakudo: say " \c[111] \c[107] ".perl 11:50
p6eval rakudo 34137: OUTPUT[" c[111] c[107] "␤]
pmichaud probably should indicate that \c isn't implemented. 11:50
pmichaud ...but isn't it \d ? 11:51
rakudo: say " \d[111] \d[107] ".perl
p6eval rakudo 34137: OUTPUT[" o k "␤]
pmichaud or did it change?
moritz_ S02:2800
You may also put one or more decimal numbers inside the square brackets:
"\c[13,10]"# CRLF
no \d[ in S02 11:52
pmichaud it changed then, it used to be \d
okay.
fixing. :-)
pugs_svn r24518 | moritz++ | [t/spec] fudge misc-interpolation.t for rakudo - passes, but it's still bad 11:53
r24518 | moritz++ | plan
ruoso pmurias, yes... that test seems to be enough... 11:53
ruoso although it doesn't test autovivifying arrays, and HoA, AoH 11:54
pmurias ruoso: hi 11:55
pmurias i'm spliting AST::Package into smaller node atm 11:55
pugs_svn r24519 | moritz++ | [t/spec] fix fudged plan of misc-interpolation.t (required ugly fudge hack) 11:59
rakudo_svn r34138 | pmichaud++ | [rakudo]: Change \d[...] to \c[...] to comply with S02 change. 12:00
r34139 | pmichaud++ | [rakudo]: update tests to match \d --> \c change in r34138.
masak cspencer++ # many bug tickets 12:01
TimToady++ # restoring my faith in Perl 6 parsing with his reply on the `say for` thing 12:02
moritz_ I have to confess I didn't quite understand that reply 12:11
masak moritz_: ok. something in particular that troubled you? 12:11
moritz_ masak: how is 'say for 1' parsed? 12:12
masak I read it as "when `for` is used as a statement modifier, it can never be confused with a listop"
masak moritz_: as a statement modifier. 12:12
moritz_ ok. 12:14
moritz_ Cursor.pmc:11 looks unnecessary complicated, and warns if STD5DEBUG isn't set 12:16
any reason not to say $ENV{STD5DEBUG} // 0 instead? 12:17
azawawi STD5DEBUG can be q{}
moritz_ and what should $_DEBUG contain in this case?
azawawi when you negative it, you get a warning 12:18
negate...
moritz_ that doesn't answer my question
azawawi warns? 12:19
azawawi moritz_: i needed the .log file to be created only if a debug flag was 1 12:21
moritz_: i will fix it 12:22
pugs_svn r24520 | pmurias++ | [mildew] 12:26
r24520 | pmurias++ | added AST::Seq for a sequence of nodes
r24520 | pmurias++ | removed AST::Package - it's now constructed from smaller nodes
r24521 | pmichaud++ | [t/spec]: Updates and fudging in S02-builtin_data_types/pair.t . 12:27
masak surprised that #61550 didn't have any spectests, I went to find the appropriate t/spec/ file to add them to, but found that moritz_++ had already added them. :) 12:30
I guess I'll just apply the patch instead.
rakudo_svn r34140 | pmichaud++ | [rakudo]: Add .kv method to Pair.
r34141 | pmichaud++ | [rakudo]: Add S02-builtin_data_types/pair.t to spectest regression.
r34141 | pmichaud++ | +63 passing tests.
pugs_svn r24522 | moritz++ | [t/spec] unfudge passing tests 12:33
pmurias azawawi: in which repo does Padre::Plugin::Perl6 live? 12:35
azawawi svn.perlide.org/padre/trunk
masak heh, moritz_++ did that as well... 12:38
moritz_ pmichaud: there are a few passing TODO tests in t/spec/S02-literals/char-by-number.t - could you please unfudge them? they are partly Unicode related, so I don't know which ones are safe to unfudge on non-icu systems 12:44
rakudo_svn r34142 | moritz++ | [rakudo] add an interpolation test to spectest.data 12:50
pugs_svn r24523 | masak++ | [t/spec/S29-list/reverse.t] fixed a test that depended on hash key order 12:51
r24523 | masak++ | during stringification
moritz_ masak++ 12:52
pmichaud moritz_: will do. Turns out I'm working on a few unicode things at the moment anyway. :-) 13:03
I've put it on my hiveminder queue 13:04
pugs_svn r24524 | azawawi++ | [Cursor.pmc] Simplified the STD5DEBUG flag and removed warnings, moritz++ 13:11
r24524 | azawawi++ | [Cursor.pmc] if defined it is 1 otherwise 0 and it also handles q{}.
r24525 | azawawi++ | [Syntax::Highlight::Perl6] Fix Cursor.pmc STD5DEBUG warning message 13:14
Minthe Finally pugs-r24512 with GHC682 worked successfully. Thank you very much. 13:29
rakudo_svn r34144 | pmichaud++ | [rakudo]: Recognize more unicode bracketing characters in quotes. 14:20
mberends akl- , is your irc client having configuration problems? 14:21
pugs_svn r24526 | pmichaud++ | [t/spec]: Unfudge rakudo tests in S02-literals/quoting-unicode.t . 14:22
pmichaud it's been doing that for a while. Maybe a chanop can /kick him?
mberends yep
rakudo_svn r34145 | pmichaud++ | [rakudo]: Add S02-literals/quoting-unicode.t to regression. +70 passing tests. 14:30
moritz_ /ignore also helps ;-) 14:32
rakudo_svn r34146 | pmichaud++ | [rakudo]: Make the unicode versions of hyperops work (e.g., »+«). 14:50
r34146 | pmichaud++ | This relegates programs containing the french angle brackets to use
r34146 | pmichaud++ | utf-8 parsing (slower), but we gain these hyperops and it may lead
r34146 | pmichaud++ | to getting french quotes to work.
mberends # the 5 minute interval suggests an experimental cron job 15:03
masak beams 15:22
TimToady driving to socal today, so feel free to pass on ops to other long-term denizens if you start running short of ops 15:24
lambdabot TimToady: You have 1 new message. '/msg lambdabot @messages' to read it.
TimToady @messages
lambdabot azawawi said 8h 52m 3s ago: it works but it introduces another bug in my tests; see 'cd ~/pugs/misc/Syntax-Highlight-Perl6; make test'. First call to STD->parse works but subsequent calls fail on
new text.
TimToady biab &
moritz_ I'm also gone, see you all 15:27
azawawi moritz_: cya
moritz_ and if I don't see you in the next few days, merry christmas!
azawawi moritz_: Merry Christmas to you too.. 15:28
where can i find a list of all builtins in perl 6? 15:29
masak moritz_: see you! but I think we'll meet here before Christmas eve :) 15:33
azawawi: S29? although it's not complete.
azawawi and S16 15:38
masak I wish I could write like _why. 16:37
masak is it fair to say that gather/take makes it possible to write coroutines in Perl 6? 17:04
Gothmog_ masak: Yes, I think so. 18:10
masak I do too.
also, I don't think anyone has written very much about stream-oriented programming in Perl 6. 18:11
pugs_svn r24527 | pmichaud++ | [t/spec]: Clean up unicode whitespace tests 18:45
r24527 | pmichaud++ | ('=' at start of line indicates <pod_comment>).
rakudo_svn r34149 | pmichaud++ | [rakudo]: Add unicode-whitespace.t test to regression (+48 passing tests) 18:50
pugs_svn r24528 | pmichaud++ | [t/spec]: Correct tests for failure from [/], [%], etc. ops. 19:15
rakudo_svn r34156 | pmichaud++ | [rakudo]: Add C<< p5=> >> operator. 19:20
r34158 | pmichaud++ | [rakudo]: Add reduce-le1arg.t to regression, +49 passing tests.
pugs_svn r24529 | pmichaud++ | [t/spec]: Fudge io_in_for_loops.t for current spec. 19:40
rakudo_svn r34159 | pmichaud++ | [rakudo]: Add S16-filehandles/io_in_for_loops.t (+25 passing tests) 19:50
cspencer yesterday i'd submitted a patch to List.pir/any-list.pir moving map/grep into the Any class so that they're accessible to ranges as well as lists 19:51
i'm assuming reduce should probably be in the same place
and probably first
pmichaud cspencer: yes.
cspencer alright, i'll submit that shortly as a patch 19:52
pmichaud excellent.
cspencer moritz had mentioned that i hadn't !EXPORT'ed them in the any-list.pir, but i wasn't able to find where that was happening when i revisited it
pmichaud they aren't supposed to be EXPORTED 19:53
cspencer oh ok
pmichaud I undid moritz++ 's change, and fixed up the namespaces a bit.
cspencer so just remove them from List.pir's export list then and move them over?
ok
pmichaud it depends on the specific function.
cspencer what does the !EXPORT do then? 19:54
pmichaud in general, if a method is marked "is export" in S29, then we use !EXPORT On it
cspencer gotcha, ok
pmichaud if there is a separate sub, then we put that sub into .namespace [] and don't !EXPORT the method
the reason is that grep { ... }, @list is different from @list.grep { ... }
cspencer ah ok, right, which is applicable to map/grep/first/reduce
ok
pmichaud for some methods, though, they act the same -- i.e., $x.abs() is the same as abs($x) 19:55
in those cases, we can just export the method instead of having to write a separate sub to handle the different signature.
cspencer right, ok, makes sense
pugs_svn r24530 | pmichaud++ | [t/spec]: Rewrite sleep.t to avoid use of cmp_ok() function. 20:08
cspencer patch submitted, should show up as ticket #61560 20:10
pugs_svn r24531 | pmichaud++ | [t/spec]: Fudge S29-hash/slice.t for Rakudo. 20:14
pugs_svn r24532 | pmichaud++ | [t/spec]: Fudge io.t for Rakudo. 20:18
rakudo_svn r34160 | pmichaud++ | [spec]: Refactor IO.readline and prefix:<=>. 20:20
r34161 | pmichaud++ | [rakudo]: Add some more spectest files to the regression suite.
pmichaud testing #61560 now. 20:23
eric256 i was adding some links for rakudo to www.perlfoundation.org/perl6/index....g_involved under Rakudo Links...any other links that would be good to list there? 20:26
rakudo_svn r34162 | pmichaud++ | [rakudo]: Refactor 'first' and 'reduce' methods to Any (RT #61560, cspencer++) 20:40
r34162 | pmichaud++ | * Patch (slightly modified) courtesy Cory Spencer <cspencer at sprocket.org>
cspencer what needed modification on that patch?
pmichaud $P0 = new 'Undef' should be $P0 = 'undef'() 20:41
or '!FAIL'('Reason for fail')
We're trying to eliminate use of the Undef type from the source
cspencer okay. which cases should Undef be eliminated in?
pmichaud basically any time we have = new 'Undef' it definitely needs to be converted to 'undef'() or something similar. 20:42
cspencer ok
pmichaud .tailcall '!FAIL'('reason') is the PIR equivalent of Perl 6's fail() function.
cspencer i'll keep an eye out for that in the future
pmichaud that'd be fantastic.
afk for a bit -- gotta talk a walk. 20:43
cspencer sure, thanks for the tips!
eric256 pmichaud: is there any resource with those tips? i'd definitly be willing to go through and make those kinds of changes (and more) if there was some document simply explaining it like you just did 21:27
i'd be happy to start such a document if none exists yet as well
pmichaud eric256: there's not a resource with those tips yet -- they change somewhat frequently. Although I expect it to be less frequent going forward from here. 21:31
I'd be very glad if you started such a document.
pugs_svn r24533 | pmichaud++ | [t/spec]: Unfudge some todo tests in char-by-number.t 21:33
masak rakudo: my @a := 1, @a; say @a[0..5] 21:36
p6eval rakudo 34162: OUTPUT[Method 'postcircumfix:[ ]' not found for invocant of class 'Int'␤current instr.: 'postcircumfix:[ ]' pc 1568 (src/classes/Positional.pir:77)␤]
masak boom!
rakudo: my @a := 1, @a; say @a.WHAT 21:38
p6eval rakudo 34162: OUTPUT[Int␤]
masak rakudo: my @a := 1; say @a.WHAT
p6eval rakudo 34162: OUTPUT[Int␤]
masak hm.
rakudo: my @a = 1; say @a.WHAT
p6eval rakudo 34162: OUTPUT[Array␤]
masak so, with infix:<:=>, I can assign an Int to a @-variable. is that kosher?
pmichaud no. 21:40
Rakudo doesn't do any type checking on binding.
(binding in general is kinda 'iffy')
masak so, the bug above is that Rakudo doesn't do type checking on binding to array variables? 21:41
pmichaud correct.
you should get a "Int does not do Positional role" exception or something like that. 21:42
masak pmichaud: isn't it also wrong that `my @a := 1, @a` doesn't produce an infinite list?
pmichaud because @array variables can only bind to objects that do positional
it would depend on how lazy/eager @a is
the way I would see it: 1, @a creates a new List 21:43
@a is then (re)bound to that new list
lambdabot Maybe you meant: activity activity-full admin all-dicts arr ask . ? @ v
masak lambdabot: ssh!
pmichaud of course, the "my" is a bit troublesome :-)
I suspect you meant: my @a; @a = 1, @a;
masak ah, maybe so. 21:44
pmichaud but no, that's not inherently infinite.
it just means that @a is bound to a List that has a (lazy?) reference to whatever @a was previously bound to.
masak rakudo: my @a; @a := 1, @a; say @a
p6eval rakudo 34162: OUTPUT[1␤]
masak I thought part of the reason for := was the ability to produce infinite arrays. 21:45
pmichaud we have hyperops that can do that :-)
I hadn't heard anything about binding and infinite arrays -- maybe I just overlooked something.
masak ISTR a Pugs example implementing fibbonacci with := and >>+<< 21:46
but that might well be obsolete
pmichaud I'd guess that one could do better with 1 xx 1..* or perhaps even 1 xx *
or 1 xx Inf 21:47
(or the hypers mentioned earlier)
masak it was something along the lines of `my @fib := 0, 1, @fib >>+<< @fib[1..*]`
pretty succinct :) 21:48
pmichaud my @fib = 0, 1, ..., { $^a + $^b }; # maybe
oh, omit the commas 21:49
masak aye
pmichaud my @fib = 0, 1 ... { $^a + $^b };
masak that's arguably prettier. 21:50
pmichaud and simpler to understand.
masak my @fib = 0, 1 ... { $^previous + $^prevprev } # :) 21:51
no, wait.
pmichaud thinks about implementing infix:<...>
oh, we probably need laziness first. 21:52
masak my @fib = 0, 1 ... { $^last + $^second_last }
pmichaud otherwise it'll end up being a really long list.
masak aye.
pmichaud masak: in your use.perl post, why not use 'when' ? 22:05
masak pmichaud: with or without a 'given'? 22:06
pmichaud either
or, for that matter, you could use 'fail' :-)
masak I could? great!
pmichaud I think so 22:07
fail 'Must be exactly two cells apart' unless ...
masak what's the 'unless' opposite of 'when'? :P
pmichaud when ... != ... { ... }
or when not ...
masak pmichaud: I thought 'when' did pattern matching, not boolean comparisons. 22:08
pmichaud it also does boolean comparisons, if you give it a boolean.
masak oh, of course. right.
pmichaud so, when 3 == 3 { say 'always do this'; }
in that case the topic is ignored, and only the truth value of the Bool is used. 22:09
masak pmichaud: 'if' is shorter that 'when', and more recognizeable, and equivalent in this context. also, it has an 'unless' opposite, which seems appropriate in some cases.
pmichaud sure
TMTOWTDI
masak but I'd have to take a closer look at that &fail builtin.
I'm not yet convinced it does a fancy return exactly the way I want. 22:10
pmichaud but part of the reason for creating 'when' and 'fail' and the like was to let Perl do these sorts of control things yet.
fail 'because'; returns an undef to the caller
masak and what happens to the string argument?
pmichaud it's the same as return undef; except that a reason for the failure is attached to the value 22:11
*to the undef
masak it sounds like exactly what I want :/
masak tries &fail
pmichaud one difference is that the reason isn't displayed on the screen, though.
so we'd have to have a way of extracting that message, I guess.
(the reason gets displayed if anything attempts to use the Failure value, at which point the message is displayed on the screen. This is how undef warnings take place, for example.) 22:12
so for that reason &fail might not be exactly what you want. 22:13
masak pmichaud: well, you saw how my "print prompt until a valid move was input" loop looked. (I'm a bit proud of that as well).
pmichaud yes, that's what I'm looking at.
It seems like fail ought to be able to help there somehow.
masak if there's any way to change that so that &fail could be used, I'm fine with using &fail.
pmichaud I'll think about it.
It's code examples and problems like this that make Perl 6 fun to play with. 22:14
otoh, your article is _very_ useful to point out how return can work. :-)
I need to write up my "okay, let's all write some Perl 6" challenge :-)
masak thanks :)
yes, please do. 22:15
pmichaud mind if I write up my suggestions about when/fail to your post?
just to get others thinking about it :-)
masak pmichaud: go right ahead.
pmichaud I need more time to write prose. Or to become a faster writer. 22:16
masak ideas are meant to be shared.
yes, I could use a keyboard speedup too.
eric256 link to the use.perl post? 22:47
isn't there a site withlike 99 problems? could be a good perl6 challenge...gotta remember the name of it though
avar 99 problems but perl 6 ain't one! 22:49
vixey avar :)
pmichaud microsoft scripting games site is the one I'm planning to point people to 22:50
literal eric256: there's examples/euler in the pugs repo 22:54
masak eric256: use.perl.org/~masak/journal/38123 22:55
literal then I also think there's a "%d problems in $some_lang" (can't remember the name) ported to Perl 6 somewhere in the repo
eric256 thats the one i was thinking of...i think 22:57
lol
literal eric256: www.oreillynet.com/onlamp/blog/2006...erl_6.html 23:01
masak rakudo: subset Positive::Int of Int where { $_ > 0 }; sub lotto (Positive::Int $count, Positive::Int $range) { return (1 .. $range).pick($count) }; say lotto(5, 40).perl 23:04
p6eval rakudo 34162: OUTPUT[[17, 9, 37, 7, 29]␤]
masak Rakudo++
literal shouldn't that be Int::Positive? :P 23:05
masak literal: I thought so, too! :)
rakudo: subset Int::Positive of Int where { $_ > 0 }; sub lotto (Int::Positive $count, Int::Positive $range) { return (1 .. $range).pick($count) }; say lotto(5, 40).perl 23:06
p6eval rakudo 34162: OUTPUT[[35, 9, 19, 3, 21]␤]
masak rakudo: subset Int::Positive of Int where { $_ > 0 }; sub lotto (Int::Positive $count, Int::Positive $range) returns List { return (1 .. $range).pick($count) }; say lotto(5, 40).perl 23:07
p6eval rakudo 34162: OUTPUT[[7, 10, 38, 23, 39]␤]
literal ah, it's in t/examples/99problems in the pugs repo
literal looks like problem 99 is missing a Perl 6 solution 23:18
literal masak: do you have anything in your .vim/.vimrc that's helpful for Perl coding? 23:22
masak literal: I just moved to this computer, and I'm still cut off from my config svn repo, so no, not right now. 23:23
ask again in a week :)
literal I see
masak 's laptop got stolen a week ago
literal ouch
masak :/
masak @tell moritz_ irclog.perlgeek.de/perl6/2008-12-20 dies of XML-malformedness when loading in my issue of Firefox. 23:53
lambdabot Consider it noted.