pugscode.org/ | nopaste: sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/ Set by diakopter on 11 July 2007. |
|||
00:05
theorb joined
|
|||
pugs_svnbot | r18435 | avar++ | [kp6-lisp] (kp6-dispatch array interpreter) not (kp6-dispatch | 00:14 | |
r18435 | avar++ | interpreter array), makes t/kp6/40-hash-keys.t pass | |||
diff: dev.pugscode.org/changeset/18435 | |||
lambdabot | Title: Changeset 18435 - Pugs - Trac | ||
00:19
devogon left,
theorbtwo left
00:26
salzh left
00:50
nipotaway is now known as nipotan
01:00
melissa joined
01:01
lyokato joined
01:04
BinGOs_ joined
01:06
daxim_ joined
|
|||
pugs_svnbot | r18436 | avar++ | Made &&, || and ?? svn st work again after adding an interpreter parameter to kp6-dispatch and dropping kp6-true, also indented some long concated code | 01:14 | |
diff: dev.pugscode.org/changeset/18436 | |||
lambdabot | Title: Changeset 18436 - Pugs - Trac | ||
01:18
BinGOs__ joined
01:20
BinGOs left,
BinGOs_ left,
Daxim left
|
|||
pugs_svnbot | r18437 | avar++ | [kp6-lisp] Make While work again, it was using kp6-true | 01:23 | |
diff: dev.pugscode.org/changeset/18437 | |||
lambdabot | Title: Changeset 18437 - Pugs - Trac | ||
01:24
polettix left
|
|||
avar beats the lisp runtime | 01:38 | ||
too much abstraction | |||
01:40
BinGOs__ left,
BinGOs joined
01:52
mfh joined
01:53
mfh left
02:01
BinGOs_ joined
02:03
salzh joined
02:17
BinGOs left
02:39
kanru joined
02:41
REPLeffect_ joined
02:42
REPLeffect_ is now known as REPLeffect
02:43
jeffreykegler joined
02:46
Limbic_Region left
|
|||
jeffreykegler | I'm looking for the BNF for Perl 6 rules. Parrot has one, but I wonder if Pugs doesn't have a more up to date one | 02:55 | |
avar | parrot has a BNF for it? | ||
jeffreykegler | Yes, somewhere under the PGE section of their code tree | 02:56 | |
02:56
amnesiac joined
|
|||
avar | pugs doesn't have one | 02:56 | |
jeffreykegler | The parrot one is search.cpan.org/src/PARTICLE/parrot...le.grammar | 02:58 | |
lambdabot | tinyurl.com/2bcvxp | ||
avar | that's not a BNF but the Perl 6 grammar | 02:59 | |
But the parrot one is probably better than the PCR/kp6 one in pugs | 03:00 | ||
jeffreykegler | Perl 6 grammars and BNF look very much alike | ||
... and not by coincidence | 03:01 | ||
03:12
weinig left
|
|||
mncharity | jeffreykegler: there is another in... | 03:21 | |
jeffreykegler | yes? | ||
mncharity | svn.openfoundry.org/pugs/src/perl6/...0.0-STD.pm | 03:22 | |
jeffreykegler | Thanks!! | ||
03:23
jeffreykegler left
|
|||
mncharity | np :) | 03:24 | |
03:24
weinig joined
03:25
weinig left,
weinig joined
03:49
Casan left
03:50
justatheory joined
04:11
nekokak_ joined
04:30
nekokak left
04:31
_go_ left
04:40
vbattsAtWork left
04:52
lyokato left
04:55
lyokato joined
05:09
_go_ joined
05:11
weinig left,
weinig joined
05:12
REPLeffect_ joined
05:17
REPLeffect left
05:20
Ashizawa joined
05:27
jhorwitz joined
05:33
jisom joined
05:43
devogon joined
05:46
BinGOs_ is now known as BinGOs
05:55
justatheory left
06:07
xinming joined
06:08
REPLeffect_ left
06:18
amnesiac left
06:20
bsb joined
|
|||
moritz_ | the up-to-date URL is svn.pugscode.org/pugs/src/perl6/STD.pm | 06:30 | |
06:31
BinGOs left
06:42
BinGOs joined
07:07
jhorwitz left
07:14
mncharity left
07:19
gorax joined
07:22
iblechbot joined
07:25
elmex joined
07:29
elmex left,
elmex joined
07:47
Aankhen`` joined
07:49
franck___ joined
07:50
xinming left
08:15
jisom left
|
|||
meppl | good morning | 08:18 | |
08:23
f0rth left
08:24
xinming joined
08:25
gorax left,
gorax joined
|
|||
moritz_ | godd morning meppl ;) | 08:27 | |
08:30
masak joined
08:38
dduncan left,
xinming_ left
09:04
cathya joined
09:10
lidden left
09:30
IllvilJa joined
09:31
kst joined
|
|||
pugs_svnbot | r18438 | ruoso++ | [yap6] documenting how to call the autotools in INSTALL, as pointed by moritz++ | 09:35 | |
diff: dev.pugscode.org/changeset/18438 | |||
lambdabot | Title: Changeset 18438 - Pugs - Trac | ||
moritz_ | ruoso: should yap6 compile currently? | 09:37 | |
09:37
fglock joined
|
|||
moritz_ | make[2]: Entering directory `/nocrypt-home/moritz/pugs/v6/yap6/src' | 09:40 | |
gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -MT const.o -MD -MP -MF .deps/const.Tpo -c -o const.o const.c | |||
In file included from const.c:3: | |||
yap6.h:25: error: expected specifier-qualifier-list before 'pthread_rwlock_t' | |||
09:40
IllvilJa left
09:41
IllvilJa joined
|
|||
ruoso | moritz_, yep... it should | 09:42 | |
which OS is yours? | |||
bette yet, which gcc version is it? | |||
09:44
IllvilJa left
|
|||
moritz_ | gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) | 09:44 | |
which answers the OS question as well ;) | |||
09:44
IllvilJa joined,
IllvilJa left
09:46
IllvilJa joined
|
|||
ruoso | hmm | 09:46 | |
I'm using gcc 4.2 | |||
Debian too | |||
maybe it's some syntax that is not supported by gcc 4.1 | |||
hmm... | 09:47 | ||
moritz_, I'll try to get some help in ##c | 09:48 | ||
09:52
lichtkind joined
|
|||
ruoso | moritz_, It looks like the symbol pthread_rwlock_t is not defined in pthread.h in your libc verson | 09:52 | |
could you grep for it in /usr/include/*.h? | 09:53 | ||
Aankhen`` | avar: I've decided to take a break from programming. | ||
(For as long as my willpower lasts. :-P) | |||
ruoso | moritz_, I've just commited a new version with another include, could you please try it | 09:54 | |
? | |||
pugs_svnbot | r18439 | ruoso++ | [yap6] adding the include wich defines pthread_rwlock_t | ||
diff: dev.pugscode.org/changeset/18439 | |||
lambdabot | Title: Changeset 18439 - Pugs - Trac | ||
moritz_ | ruoso: it occurs in pthread.h, but not as a definition | ||
ruoso | moritz_, hmm... I just found out | ||
I *must* include types.h | 09:55 | ||
for it to work... | |||
moritz_ | do I need to regen configure before compiling? | ||
ruoso | moritz_, I've commited again | ||
pugs_svnbot | r18440 | ruoso++ | [yap6] using the correct header | ||
diff: dev.pugscode.org/changeset/18440 | |||
lambdabot | Title: Changeset 18440 - Pugs - Trac | ||
ruoso | no... | ||
moritz_ | good | ||
ruoso | simple make test should do it | 09:56 | |
moritz_ | make clean; make; gives the same error | 09:57 | |
r18440 | |||
ruoso | hmhmhm... | 09:58 | |
moritz_ | #if defined __USE_POSIX199506 || defined __USE_UNIX98 | ||
# include <bits/pthreadtypes.h> | |||
#endif | |||
from sys/types.h | |||
do you define either of them? | |||
ruoso | nope... | ||
brb & | |||
moritz_ | ruoso: I have a (non-production) server with etch where I can reproduce the problem... would you like a shell account there? | 10:02 | |
10:18
thepler left
10:19
gorax left
10:20
salzh left,
gorax joined
|
|||
ruoso | lists.debian.org/debian-user/2002/0...02931.html | 10:21 | |
lambdabot | Title: Re: Woody: pthread_rwlock_t error | ||
ruoso | moritz_, seems related to that | ||
pugs_svnbot | r18441 | ruoso++ | [yap6] added -D_GNU_SOURCE as pthread_rwlock_t seems to be gnu libc related | 10:23 | |
diff: dev.pugscode.org/changeset/18441 | |||
lambdabot | Title: Changeset 18441 - Pugs - Trac | ||
ruoso | moritz_, could you try this last version/ | ||
moritz_ | ruoso: yes, trying... | ||
ruoso: now it compiles, thanks | 10:24 | ||
ruoso | :) | ||
moritz_, thanks for the report :) | 10:25 | ||
moritz_ | and "All tests successful." | ||
ruoso | :) | ||
fglock, could you test the last version in OSX? | |||
make -f Makefile.cvs; ./configure; make test | |||
fglock | ruoso: testing | ||
"All tests successful" | 10:27 | ||
ruoso | :) | ||
moritz_ | GNU's c libs are a bit weird sometimes ;) | ||
fglock | but "warning: passing argument 3 of āpthread_createā from incompatible pointer type" | ||
Aankhen`` | It's C. :-) | 10:28 | |
ruoso | fglock, yep... I saw that, and I still don't get it... | ||
fglock, hmmm... i got it... | 10:30 | ||
the thread function callback must return void*, not void... :) | |||
moritz_ | bah, just one char difference ;) | 10:31 | |
ruoso | heh | ||
pugs_svnbot | r18442 | ruoso++ | [yap6] thread callback must return void*, not void | 10:32 | |
diff: dev.pugscode.org/changeset/18442 | |||
lambdabot | Title: Changeset 18442 - Pugs - Trac | ||
11:43
Caelum left
11:45
rindolf joined
11:49
f0rth joined
11:50
rindolf left
11:55
elmex left
11:56
elmex joined
12:07
nipotan is now known as nipotaway
|
|||
avar | Aankhen``: my $sub = { say 5 + 5 }; | 12:08 | |
I can then do: | |||
(let ((code (kp6-cell-value (lookup-lexical-variable/c (kp6-generate-variable "$" "sub"))) )) | |||
(apply (kp6-value code) |Main| (list))) | |||
to have .() kinda work | |||
which means I need to poke Code.lisp | |||
12:09
Ashizawa left
12:12
bsb left
12:15
thepler joined
12:24
cmarcelo joined
12:30
fglock left
12:38
funktio joined
12:41
Caelum joined
13:03
gorax left
13:04
gorax joined,
gorax left
13:11
fglock joined
13:36
cathya left
13:37
rindolf joined
13:45
DarkWolf84 left
13:47
lyokato left
13:57
kanru left
14:25
vbattsAtWork joined
14:31
devogon left
14:40
Torment left
|
|||
pugs_svnbot | r18443 | ruoso++ | [yap6] List destruction, List_ProxyScalar destruction, consts destruction, no leaks at the moment. | 14:45 | |
diff: dev.pugscode.org/changeset/18443 | |||
14:45
kcwu left
|
|||
lambdabot | Title: Changeset 18443 - Pugs - Trac | 14:45 | |
14:45
Jedai joined
14:46
drrho joined
14:48
kcwu joined
|
|||
ruoso | fglock, lists already destroy themselves... :) garbage collection is working ;) | 14:51 | |
if you compile enabling the -DYAP6_MEM_TRACE in Makefile.am you'll see all the process | |||
fglock | :) | 14:53 | |
ruoso | make -f Makefile.cvs; CFLAGS='-DYAP6_MEM_TRACE' ./configure; make check; ./src/04_list.t | ||
fglock | still reading about stm ... | ||
15:10
TJCRI joined
15:14
masak left
15:21
drrho left
|
|||
ruoso | considering the expression $A < $B... if $A is a String and $B is an integer... is the comparision goin to be made in string or int context? | 15:21 | |
moritz_ | ruoso: < is num context | 15:22 | |
ruoso | I would presume the left-hand operand ($A) would have precedence and stringify $B | ||
ahmm | |||
duhh | |||
moritz_ | le is string | ||
ruoso | of course | ||
heh | |||
ruoso already with some C damage | |||
avar | $A.Int < $B.Int | 15:24 | |
ruoso definitively already with C damage | 15:26 | ||
:) | |||
15:33
vbattsAtWork left
15:34
vbattsAtWork joined
|
|||
funktio | does anyone else think that it would be nice if $foo.chars returned an array in list context? | 15:36 | |
then my @a = $foo.chars; would give a more intuitive result | 15:37 | ||
15:38
weinig left
|
|||
avar | $foo.split('') | 15:39 | |
.#chars and .chars ?:) | 15:41 | ||
15:51
REPLeffect_ joined
|
|||
PerlJam | funktio: isn't it specced to do so? | 16:02 | |
funktio | PerlJam: I don't know, actually | ||
moritz_ | PerlJam: $str.chars returns the number of chars in $str | 16:05 | |
PerlJam | moritz_: even in an array context? | 16:06 | |
TimToady | yes, even in list context | 16:07 | |
ruoso | now that I fixed my brain damage... which are the native types that everything must be able to cast into? String, Int and Bool? | 16:08 | |
[particle] | Num | ||
ruoso | yep yep... not Int, but Num... | ||
16:09
amnesiac joined
|
|||
ruoso | any other? | 16:09 | |
TimToady | It is not required that a Num cast be possible, I think | ||
ruoso | but string is? | 16:10 | |
16:10
Psyche^ joined
16:11
chris2 joined
|
|||
TimToady | It's good if an accidentally printed thing gives some indication of what it is | 16:11 | |
it's not required to give a complete value | |||
ruoso | sure... | 16:12 | |
TimToady | see p5's CODE(0xdeadbeef) for instance | ||
ruoso | it's just a coercion | ||
TimToady | given interesting values of undef, I think the default Num coercion should probably be to one of those | ||
fail "I don't know how to convert { self.WHAT } to Num" or some such | 16:13 | ||
ruoso | but... | ||
that means $a < $b will fail if that thing isn't numifiable | 16:14 | ||
wolverian | at compile time hopefully | ||
ruoso | I like p5 concept that if it can't numify, then it's a zero | ||
wolverian, we can't count on that... | |||
PerlJam | ruoso: good thing p6 does that too :) | 16:15 | |
ruoso | not for writing a runtime... | ||
TimToady | maybe there are interesting values of undef that just warn on usage | ||
ruoso | but the problem is that | ||
$a < $b *will use* the value | 16:16 | ||
so the warning *if* is pointless | |||
wolverian | ruoso, yeah. anyway, while str->num coercion is good, a failure in the coercion being silently ignored is something I've never used in perl 5, I think. | ||
ruoso | undef -> num is quite used | ||
TimToady | it's something you want to give some knob to turn to adjust it | 16:17 | |
certainly with hyperops we're not going to want to be exception happy | |||
ruoso | perl -we 'my $a; $a++;' | ||
would that give a warning in P6? | 16:18 | ||
TimToady | no | ||
but uninitialized is a different kind of undef in p6 | |||
doesn't mean that something went wrong, only that something has not yet gone right | 16:19 | ||
all the "class" names are more in that category, so we call them protoobjects | |||
wolverian | ruoso, well I assume undef could numify to zero.. | ||
[particle] | in perl 6, postfix:-- is magical too, right? | ||
wolverian | that's different from "a" numifying to zero, I think | ||
TimToady | supposed to be magical, yes | ||
16:19
beppu left
|
|||
[particle] | so, my $a; $a-- produces...? | 16:19 | |
TimToady | error, probably. | 16:20 | |
[particle] | okay. | ||
TimToady | there's no guarantee that -- is symmetric with ++ | ||
[particle] | great. that's just what i was hoping for. | ||
ruoso | I don't get it... why wouldn't it be -1 | ||
? | |||
TimToady | it could do that too | ||
but I think the spec currently says error | 16:21 | ||
ruoso | that would certainly surprise me | 16:22 | |
TimToady | errors are supposed to do that | ||
ruoso | heh | ||
but... why? | |||
why would it give an error? | 16:23 | ||
TimToady | you bend it and it snapped | ||
16:23
justatheory joined
|
|||
TimToady | *bent | 16:23 | |
ruoso | why wouldn't it numify the unintialized-undef and subtract 1? | 16:24 | |
16:24
perlmonkey2 joined
|
|||
ruoso | like p5 does | 16:24 | |
[particle] | who's to say it's not Inf? | ||
TimToady | would depend on how fatal you're running, but default is to throw an exception on use of a Failure | 16:25 | |
you can be either more or less fatal than that | |||
ruoso | [particle], I know it's arbitrary... but it have been arbitrarly defined in p5 already... | ||
TimToady | for a spacecraft you might set everything to completely failsoft | 16:26 | |
wolverian | I'm not convinced :) | ||
ruoso | me neighter... | ||
16:27
weinig joined,
Patterner left,
Psyche^ is now known as Patterner
|
|||
ruoso | I could agree that if you try to do my $a = some_sub_that_failed(); $a--; # it might give an error | 16:27 | |
16:27
xinming_ joined
|
|||
ruoso | it even should | 16:27 | |
PerlJam | ruoso, wolverian: how about this: because perl 6 is *different* ;-) | ||
ruoso | heh | ||
wolverian | I meant I'm not convinced about the spacecraft :) | 16:28 | |
16:28
xinming left
|
|||
wolverian | I can imagine failsoft would lead to eventual corruption of the state of the whole system | 16:28 | |
TimToady | well, sure, even the softest pillow may have a hard floor under it | 16:29 | |
keep going down you eventually hit something solid | |||
amnesiac | uhm... pillow... | ||
TimToady | but we still give people options on how thick the pillow is | 16:30 | |
PerlJam | I'd rather not hit something solid in a spacecraft, but rather gently land upon it. | ||
wolverian | and I appreciate it a lot, and think it's an interesting problem | ||
[particle] | you can't fool me. it's pillows all the way down! | ||
moritz_ | that's why you want to be on the outside of the spacecraft - the next hardest pillow is literally miles away ;) | ||
wolverian | I hope someone is logging search.cpan searches, because I just tried to find "charlie and the chocolate factory" | 16:31 | |
fingers-- | |||
szbalint | hehe | ||
moritz_ | and did you find a suitable module? | 16:32 | |
TimToady | and what happens after you do that 11 times? | ||
szbalint | it might get cached | ||
:) | |||
wolverian | moritz_, no :( | ||
TimToady | I want the world, I want the whole world, I want it *now*!!! | ||
szbalint | hm, cache miss | 16:33 | |
:] | |||
ruoso | but getting back... Bool coerce is mandatory? | 16:34 | |
TimToady | yes | 16:35 | |
Tene | perhaps search results would be an interesting way to see what people are looking for but aren't finding. | ||
ruoso | at least my $a; if ($a) doesn't give an error ;) | ||
TimToady | even values of undef have a Bool coercion :) | ||
[particle] | my $a; $a-- if $a :) | ||
TimToady | .oO(bunch of scab pickers...) |
16:36 | |
moritz_ | kp6: my $a; if $a { say "yes"; } | ||
exp_evalbot | r18443: OUTPUT[Falseā¤] | ||
16:37
weinig_ joined
|
|||
TimToady | kp6: my $a; list do { if $a { say "yes"; } } | 16:38 | |
exp_evalbot | r18443: OUTPUT[DISPATCH: calling APPLY KindaPerl6::Runtime::Perl5::DispatchSugar::Dispatch=HASH(0x85c8b44) on invalid object:$VAR1 = {};ā¤ā¤ at compiled/perl5/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 33ā¤ main::DISPATCH('undef', 'APPLY', | ||
..'KindaPerl6::Runtime::Perl5::DispatchSugar::Dispatch=HASH(0x85...') called at - line 20ā¤] | |||
[particle] | *cough* | ||
TimToady | kp6: my $a; say (if $a { "yes"; } ) | 16:39 | |
16:39
franck___ left
|
|||
exp_evalbot | r18443: OUTPUT[0ā¤] | 16:39 | |
TimToady | kp6: say (if '' { "yes"; } ) | 16:40 | |
exp_evalbot | r18443: OUTPUT[0ā¤] | ||
TimToady | that should not be outputting a 0 | ||
ruoso | that's probably a p5 value leaking... | ||
TimToady | in a list context the false if should return () | ||
ruoso | ah | ||
that | 16:41 | ||
moritz_ | TimToady: if the expression doesn't produce an output, it is re-run with ((...).perl).say around it | ||
ruoso | kp6 doesn't implement context yet | ||
TimToady | so you can use it to make list comprehensions | ||
ruoso | that's something I'm trying to do in yap6 | ||
TimToady | okay, so it's printing the return value of the say, I guess | ||
16:42
thoughtpolice left
|
|||
moritz_ | TimToady: presumably, yes | 16:42 | |
ruoso | nope... the return of the if | ||
TimToady | kp6: say '' | ||
ruoso | which is hmm | ||
exp_evalbot | r18443: OUTPUT[ā¤] | ||
ruoso | kp6: if (0) { } | ||
TimToady | hmm | ||
exp_evalbot | r18443: OUTPUT[Falseā¤] | ||
ruoso | kp6: if ('') { } | ||
exp_evalbot | r18443: OUTPUT[Falseā¤] | ||
ruoso | hm? | ||
moritz_ | I should patch exp_evalbot not to print OUTPUT if it isn't output... | ||
ruoso | kp6: (if ('') { }) | ||
exp_evalbot | r18443: OUTPUT[Falseā¤] | ||
ruoso | kp6: say (if ('') { }) | ||
exp_evalbot | r18443: OUTPUT[0ā¤] | 16:43 | |
ruoso | hmm | ||
yep... | |||
it's the return of say | |||
but it's the evalbot, not the say itself | |||
[particle] | kp6: say | ||
exp_evalbot | r18443: OUTPUT[ā¤] | ||
ruoso | hmm | ||
[particle] | kp6: say False | ||
exp_evalbot | r18443: OUTPUT[0ā¤] | ||
wolverian | kp6: say False | ||
exp_evalbot | r18443: OUTPUT[0ā¤] | ||
ruoso | hah | ||
wolverian | [particle], damn you. | ||
Tene | kp6: False | ||
exp_evalbot | r18443: OUTPUT[Falseā¤] | ||
avar | kp6: '' && "t" || "nil" | 16:44 | |
exp_evalbot | r18443: OUTPUT[Falseā¤] | ||
avar | kp6: say '' && "t" || "nil" | ||
exp_evalbot | r18443: OUTPUT[0ā¤] | ||
ruoso | avar, precedences are not right also... | ||
avar | kp6: say '' ?? "t" !! "nil" | ||
exp_evalbot | r18443: OUTPUT[nilā¤] | ||
ruoso | or they are... | ||
ruoso confused now | |||
yep... precedence is not right... | 16:45 | ||
kp6: say ('' && 't' || 'nil') | 16:46 | ||
exp_evalbot | r18443: OUTPUT[0ā¤] | ||
ruoso | kp6: say (('' && 't') || 'nil') | ||
exp_evalbot | r18443: OUTPUT[nilā¤] | ||
TimToady | moritz_> ruoso: < is num context | 16:47 | |
that's an oversimplification | |||
moritz_ | TimToady: then enlighten me ;) | 16:48 | |
TimToady | it just dispatches to infix:<< < >> | ||
and there is an exact match with (Num, Num) | |||
otherwise (Any,Any) coerces | 16:49 | ||
but any user defined operator can slip in between | |||
16:49
BinGOs_ joined,
BinGOs left
|
|||
TimToady | and, although it is encouraged that it support "num" semantics, it's not required | 16:49 | |
16:49
BinGOs_ is now known as BinGOs
|
|||
ruoso | so, $a < $b is not necessarly $a.num < $b.num | 16:49 | |
moritz_ | TimToady: so what does the (Any, Any) multi do? | ||
ruoso | $a.lt($b) | 16:50 | |
? | |||
TimToady | $a.Num < $b.Num, presumably | ||
ruoso | and fails if it doesn't support numification? | ||
TimToady | by default, yes, I expect | 16:51 | |
wolverian | hum. I thought the dispatcher coerces. | ||
ruoso | fails here is a "die"? | ||
a warn? | |||
TimToady | dispatcher never coerces | ||
moritz_ | I'd guess "fail" | 16:52 | |
ruoso | if a warn, what is the result? | ||
ruoso trying to translate p5 context | |||
TimToady | if .Num returns a Failure, then you could define variants for (Failure, Num) etc | ||
ruoso | so (Failure,Failure) is false? | ||
16:53
weinig left
|
|||
TimToady | Failure < Failure is not defined currently, afaik | 16:53 | |
moritz_ | multi dispatching operators... nice idea, really ;) | ||
[particle] | NaN | ||
ruoso | moritz_, tell that to the runtime | ||
16:54
BinGOs_ joined
|
|||
TimToady | yes, a good argument could be made for returning NaN by default instead of Failure | 16:54 | |
ruoso | NaN makes more sense... yes... | ||
this would make everything numifiable | 16:55 | ||
moritz_ | ruoso: the compiler should do as much time inference at compile time as possible, and do the multi dispatch at compile time if possible as well | ||
TimToady | or some Failure variant that keeps all the juicy "where did things go wrong" details but otherwise behaves as NaN if coerced from Num to num | ||
ruoso | moritz_, which won't happen most of the time... | ||
16:55
BinGOs left
|
|||
moritz_ | ruoso: so that pure numerica comparisons will be cheap | 16:55 | |
16:55
BinGOs_ is now known as BinGOs
|
|||
[particle] | NaN does Failure? vice versa? | 16:55 | |
ruoso | something is Failure does NaN | 16:56 | |
moritz_ | ruoso: you can view it as yet another challenage ;) | ||
[particle] | ruoso++ | ||
ruoso | moritz_, it's just a matter that, for the common case (like, getting the element of a AoH) doesn't allows any compile-time inference... | ||
the problem is that NaN is an instance of Num | 16:57 | ||
not a Role | |||
TimToady | individual values are just considered maximally constrained subtypes, if it helps | ||
ruoso | hmnm.. | 16:58 | |
so $a does 5 makes sense? | |||
fglock | is Failure but NaN ? | ||
moritz_ | ruoso: unless you have an explicit type declaration for that AoH | ||
TimToady | True and False are both values and subtypes of Bool | ||
ruoso | moritz_, sure... I'm just saying that we can't count on that... | ||
TimToady | subtypes can function as "Just" types | 16:59 | |
[particle] | Brilliant but True | ||
TimToady | normal types are "Maybe" types in p6 | ||
ruoso can't actually visualize the instance composition in that case... | 17:00 | ||
what would the Failure but NaN object look like? how would it be built? | 17:01 | ||
TimToady | a "but" doesn't have to do a composition if the mixed in interface is constant. | 17:02 | |
all that is required is that .Num return NaN when called on that object | 17:03 | ||
17:04
Southen_ joined,
barney joined
|
|||
ruoso | but how does it know which methods to mix? | 17:04 | |
TimToady | NaN knows it's a value of Num, just as True knows it's a Bool | ||
ruoso | I mean... Num have other methods... | ||
17:05
blindfish joined
|
|||
TimToady | well, you end up with a type something like Num.assuming(NaN:) so the generic instantiation can presumably optimize away any other possible values if it wants to get fancy | 17:07 | |
avar | anyone know of a simple (numeric?) algorithmic problem I could try in kp6? I want to benchmark the mp6 and lisp backends | 17:08 | |
ruoso can't think how to transport that to yap6 | |||
avar | sial.org/pbot/28062 # this ends in deep recursion | ||
lambdabot | Title: Paste #28062 from Someone at 208.78.101.240 | ||
fglock | ruoso: this can be implemented at the kp6 level | ||
ruoso | fglock, kinda... | 17:09 | |
moritz_ | avar: what about iterative sqrt() computation? | ||
ruoso | because the data in the low level | ||
needs to support this kind of context | |||
avar | moritz_: I'd have to implement sqrt() but sure, got code?:) | ||
[particle] | fibonacci? | ||
moritz_ | avar: wait a second... | ||
avar | [particle]: see my paste | ||
ruoso | if a value is a subtype... my $a isa Foo but $b is valid, right? | 17:10 | |
and $b can be anything, right? | 17:11 | ||
how $a is composed? | 17:12 | ||
pasteling | "moritz_" at 89.13.152.193 pasted "iterative sqrt calculation in full p6" (13 lines, 184B) at sial.org/pbot/28063 | ||
moritz_ | avar: that's in full perl6, but it should be trivial to port to kp6 | ||
actually I could do something like this to implement sqrt() in pure perl | 17:14 | ||
avar | uh, pre and post? | 17:17 | |
moritz_ | avar: you can omit that | ||
Aankhen`` | Contracts? | 17:18 | |
moritz_ | avar: it's just an example I used for a tutorial | ||
pasteling | "ruoso" at 82.154.252.25 pasted "Trying to understand how the object is composed..." (18 lines, 229B) at sial.org/pbot/28064 | ||
moritz_ | avar: yes | ||
Aankhen`` | Assertions, I guess. | ||
ruoso | TimToady, could you take a look at the paste above? | ||
moritz_ | Aankhen``: if you do "design by contract" than an assertion is a "contract" ;) | ||
Aankhen`` | Yeah, but I figure DBC is simply fancy nomenclature specialized for OOP. ;-) | 17:19 | |
moritz_ | Aankhen``: indeed ;) | ||
Aankhen``: but it's cool that assertions are inherited | |||
Aankhen`` | Def. | 17:20 | |
moritz_ | I learned Eiffel a couple of year ago, and it's quite a cool language | 17:22 | |
but the syntax suffers from bad huffmann coding | |||
wolverian | it felt completely overengineered for me | ||
but that is possibly because of the syntax | 17:23 | ||
TimToady | ruoso: mixins clobber methodnames in superclasses, so .name would refer to Dog after the "but" | ||
moritz_ | wolverian: the librarires are bit overengineered, yes ;) | ||
TimToady | and you don't get an error on conflicts with mixins, which is why compile-time composition is preferred | ||
moritz_ | wolverian: but for bigger projects it's certainly a nice language | ||
ruoso | so, the but is kinda the same of does | 17:25 | |
TimToady | does is really just but= I suspect | ||
ruoso | ah... ok... | ||
avar | pugs: 1e-8 | 17:26 | |
exp_evalbot | OUTPUT[1/100000000ā¤] | ||
avar | does p6 have lossless fraction calculations? | 17:27 | |
moritz_ | avar: yes | ||
TimToady | though but may also enforce some value semantics where the objects might prefer not to be values | ||
moritz_ | avar: wait, pugs does | ||
avar | yay, more common lisp features:) | ||
moritz_ | avar: p6 not, I think | ||
ruoso | TimToady, for example? | 17:28 | |
avar | moritz_: urgh, that would be lame:) | ||
ruoso | and wait... what kind of object is not a value? | ||
avar | Junction? | ||
moritz_ | avar: I think nobody will stop you from implementing it, as long as you still provide native floating points | 17:29 | |
fglock | ruoso: containers | ||
ruoso | a container itself is a value that has another value | 17:30 | |
TimToady | different responses to <=> and cmp | ||
avar | syntax error at position 211, line 14 column 49: | 17:32 | |
while (abs ($w * $w - $x) > $one_e_minus_8) { | |||
^ HERE | |||
ruoso | so... <=> sees if the value can Num, if not, tries to see if it's a junction? | 17:33 | |
TimToady | avar: division of integers is allowed to keep result as Rat, see S03:673 | ||
ruoso | and a Junction can't numify | ||
except it you do a but | 17:34 | ||
17:34
Psyche^ joined
|
|||
ruoso | is it right? | 17:34 | |
avar | TimToady: not division of Rat? | ||
CL-USER> (+ 5/9 3/4) | |||
47/36 | |||
ruoso kinda-confused | |||
avar | pugs: 5/9 + 3/4 | ||
exp_evalbot | OUTPUT[47/36ā¤] | ||
TimToady | ruoso> so... <=> sees if the value can Num... | 17:35 | |
no, that's inside out | |||
17:35
apple-gunkies joined
|
|||
TimToady | the dispatcher pays attention to Num vs Junction. the individual operators don't care | 17:35 | |
ruoso | the object's dispatcher? | ||
TimToady | and only infix:<< <=> >>(Any,Any) coerces to Num | 17:36 | |
ruoso | or the operator dispatcher? | ||
TimToady | MMD does not belong to any one class | ||
ruoso | but the implementation must be somewhere :) | 17:37 | |
pugs_svnbot | r18444 | fglock++ | [kp6] added 'but' to grammar | ||
diff: dev.pugscode.org/changeset/18444 | |||
lambdabot | Title: Changeset 18444 - Pugs - Trac | ||
ruoso | I mean... it's in the <=> implementation | ||
avar | I thought the operatiors did $arg.Int or something | ||
TimToady | what is this "the" you keep mentioning? | ||
avar | that's how MOP works in kp6, you need something you request it | ||
TimToady | there can be many implementations of <=> | ||
ruoso | TimToady, by "the" I mean "the set formed by the MMD options" | 17:38 | |
avar | oh you mean based on multis? | ||
nevermind | |||
dept-info.labri.fr/~strandh/features.text | |||
TimToady | multiple dispatch is actually more fundamental to P6 than single dispatch | ||
single dispatch can be viewed as a degenerate case | 17:39 | ||
avar | fglock: is the reason you wrote your own object system instead of piggy-backing on the p5 one that you can't really create classes at runtime? | ||
ruoso | avar, the p5 classes can't implement all the context of p6 | ||
avar | which part? | ||
ruoso still have to find out how to bootstrap the introspection in yap6 | 17:40 | ||
fglock | avar: several reasons, except for performance | ||
avar | fglock: can you elaborate? some of them might apply to clos | ||
ruoso | lexical classes | 17:41 | |
mmd | |||
composition | |||
fglock | avar: I think the p6 object system mostly map to CLOS | 17:42 | |
Aankhen`` | ā¦delegation? | ||
TimToady | fglock: but not multiple dispatch | ||
Aankhen`` | ā¦parallel dispatch? | ||
ā¦submethods? | 17:43 | ||
avar | fglock: and do you know why sial.org/pbot/28065 fails to compile? | ||
lambdabot | Title: Paste #28065 from Someone at 208.78.101.240 | ||
ruoso | is comparing 'HOW' an possible way of seeing if two objects are of the same type? | ||
Aankhen`` | ā¦customized constructors? | ||
ruoso: Doesn't HOW return the metaclass? | |||
TimToady | ruoso: no, that only tells you if they have the same metaobject instance | ||
moritz_ | ruoso: why not .WHAT? | ||
Aankhen`` | avar: Last line of &abs, perhaps. | 17:44 | |
ruoso | Could anyone give me a hint on how to do that in yap6? | ||
Aankhen`` | Might need more parentheses. | ||
moritz_ is just spilling bullshit tonight and should shut up | |||
ruoso | I need to bootstrap the introspection | ||
Aankhen`` | ($num < 0) ?? -($num) !! $num; # try that | ||
avar | no it's: | 17:45 | |
syntax error at position 212, line 14 column 48: | |||
while (abs($w * $w - $x) > $one_e_minus_8) { | |||
^ HERE | |||
ruoso | svn.pugscode.org/pugs/v6/yap6/src/yap6.h | ||
TimToady | bbl & | ||
ruoso | that's the data structure I'm working on | ||
Aankhen`` | The error messages in KP6 areā¦ a tad misleading at times. | ||
But if that is indeed the point, try throwing some parentheses into the &abs call. | |||
abs(($w * $w) - $x) > $one_e_minus_8) | 17:46 | ||
avar | nah, stiff fails | 17:47 | |
while ((abs(($w * $w) - $x) > $one_e_minus_8)) { | |||
$w = 0.5 * ($w + $val / $w ); | |||
}; | |||
*still | |||
Aankhen`` | Add more parentheses in the $w = ... line? | 17:48 | |
moritz_ | is abs() implemented? | 17:49 | |
kp6: sub abs($a){ $a < 0 ?? (-1)*$a !! $a }; say(abs(3)) | 17:50 | ||
exp_evalbot | r18444: OUTPUT[error in Block at compiled/perl5/lib/KindaPerl6/Grammar/Sub.pm line 362, <> line 1.ā¤Bareword found where operator expected at - line 2, near "* Syntax Error"ā¤ (Missing operator before Error?)ā¤syntax error at - line 2, near "* Syntax Error in "ā¤Illegal declaration of subroutine | 17:51 | |
..main:: at - line 2.ā¤] | |||
17:51
Patterner left,
Psyche^ is now known as Patterner
|
|||
moritz_ | kp6: sub my_abs($a){ $a < 0 ?? (-1)*$a !! $a }; say(my_abs(3)) | 17:51 | |
exp_evalbot | r18444: OUTPUT[error in Block at compiled/perl5/lib/KindaPerl6/Grammar/Sub.pm line 362, <> line 1.ā¤Bareword found where operator expected at - line 2, near "* Syntax Error"ā¤ (Missing operator before Error?)ā¤syntax error at - line 2, near "* Syntax Error in "ā¤Illegal declaration of subroutine | ||
..main:: at - line 2.ā¤] | |||
17:56
barney left
|
|||
pugs_svnbot | r18445 | fglock++ | [kp6-perl] 'but' implementation; needs more work | 17:56 | |
diff: dev.pugscode.org/changeset/18445 | |||
lambdabot | Title: Changeset 18445 - Pugs - Trac | ||
fglock | kp6: my $a = 1 but "x"; say $a | 17:57 | |
exp_evalbot | r18445: OUTPUT[xā¤] | ||
moritz_ | kp6: my $a = undef but 3; say $a; | 17:59 | |
exp_evalbot | r18445: OUTPUT[Undefā¤] | ||
moritz_ | kp6: my $a = undef but 'a'; say $a; | 18:00 | |
exp_evalbot | r18445: OUTPUT[Undefā¤] | ||
avar | my $a = "cat" but "fine too"; say $a | 18:01 | |
kp6: my $a = "cat" but "fine too"; say $a | |||
exp_evalbot | r18445: OUTPUT[fine toofine too] | ||
18:01
barney joined
18:03
penk joined,
funktio left
|
|||
fglock | that's the "needs more work" part | 18:04 | |
moritz_ | so how is decided which part to use for coercion? | 18:05 | |
18:05
Notrix joined,
vel joined
|
|||
moritz_ | if I have a '$foo but $bar', is the check if $bar has a .Str method, and if not $foo.Str is called? | 18:06 | |
avar | moritz_: dev.pugscode.org/changeset/18445 | ||
lambdabot | Title: Changeset 18445 - Pugs - Trac | ||
fglock | it calls .Str on $bar, if $bar is Str | 18:07 | |
i think | |||
avar | .str if $bar is Str | ||
fglock | avar: i think .str is now .Str | 18:08 | |
avar | yeah, but your but code does .dstr | ||
*.str | |||
moritz_ | well, .$type should be called if you want to coerce to $type | 18:09 | |
see r14464 of the synopsis | 18:10 | ||
18:10
TJCRI left
|
|||
moritz_ | roughly S13:143 | 18:11 | |
18:13
jhorwitz joined
|
|||
fglock | yes, but this is better be fixed in all code at once | 18:13 | |
moritz_ | right | ||
rgrep '\bstr\b' src/|wc -l | 18:14 | ||
480 | |||
of course there are many false positives | 18:15 | ||
18:19
mncharity joined
|
|||
ruoso | (Failure but NaN) isa Num? | 18:23 | |
18:27
apple-gunkies left
18:30
Torment joined
|
|||
fglock | it's still Failure | 18:31 | |
hmm - maybe | |||
18:31
TJCRI joined
18:34
vel_ joined
18:40
barney left,
jisom joined,
weinig_ left
18:49
Jedai left
18:51
vel left,
Limbic_Region joined
18:56
chris2 left
19:00
chris2 joined
19:17
weinig joined
19:22
vbattsAtWork left
19:25
amnesiac left
19:28
vbattsAtWork joined
|
|||
PerlJam | Is it just me or does *adding* something to *not* capture seem weird? | 19:28 | |
moritz_ | PerlJam: that's what p5 uses as well... ( captures and (?: doesn't | 19:29 | |
PerlJam: so <. as opposed to < is an improvement ;) | |||
PerlJam | If you say so. | ||
moritz_ | I do ;) | 19:30 | |
PerlJam | I'm not entirely sure, but I think I'd be happier if the default were to not capture and then <.foo> would capture | 19:31 | |
and $/.foo might do something useful too | |||
moritz_ | PerlJam: actually it depends on what you want to make the default - I see no gain in intuitiveness one way or another | ||
PerlJam | I'm prematurely optimizing perhaps, but making capturing the default seems like it'll put the RE engine through lots more work in the general case | 19:32 | |
19:32
_REPLeffect joined
|
|||
PerlJam | (I think most people will care to use grammars for their readability, but not care to capture so much) | 19:32 | |
19:33
REPLeffect_ left,
miyagawa joined,
_REPLeffect is now known as REPLeffect
|
|||
fglock | & | 19:33 | |
moritz_ | PerlJam: well, that's a good point (but not if your primary concern is to write parsers) | 19:34 | |
19:38
jhorwitz left
|
|||
moritz_ | @karma moritz_ | 19:42 | |
lambdabot | You have a karma of 10 | ||
moritz_ | @karma moritz | ||
lambdabot | moritz has a karma of 114 | ||
19:46
jisom left
19:55
fglock left
19:59
Limbic_Region left
20:05
kst left
20:09
vbattsAtWork left
20:14
Notrix left
20:15
lambdabot left,
lambdabot joined
20:17
tewk left,
vel joined
20:21
weinig_ joined,
weinig left
20:33
vel_ left
20:45
chris2 left
20:50
miyagawa left
20:52
devogon joined
21:02
iblechbot left
21:03
drupek12 joined
21:07
lichtkind left
21:08
rindolf left
|
|||
meppl | good night | 21:11 | |
21:12
TJCRI left
21:14
BinGOs left
|
|||
moritz_ | good night meppl ; | 21:18 | |
21:20
BinGOs joined
|
|||
PerlJam | moritz_: interesting question on perlmonks | 21:26 | |
21:26
weinig_ left
21:28
Aankhen`` left
|
|||
meppl | ;) | 21:33 | |
21:49
blindfish left
21:56
thoughtpolice joined
22:03
Notrix joined
22:07
perlmonkey2 left,
rlb3_work left
22:08
renormalist joined
22:14
rlb3_work joined
22:18
Lunchy joined
22:20
beppu joined
22:22
weinig joined
22:25
penk left
22:29
penk joined
22:34
renormalist left
22:35
Patterner left
22:37
weinig_ joined
22:43
Notrix left
22:45
Psyche^ joined,
Psyche^ is now known as Patterner
22:54
weinig left
22:55
weinig joined
23:00
weinig left
23:11
weinig joined
23:12
weinig_ left,
cmarcelo left
23:13
REPLeffect_ joined,
REPLeffect left
23:14
REPLeffect_ is now known as REPLeffect
23:16
BinGOs_ joined
23:21
BinGOs left
23:22
lambdabot left
23:23
lambdabot joined,
REPLeffect left
23:54
penk left
|