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.
Juerd Let's ask rafl what's going on then :) 00:02
rafl: ping :)
rafl Juerd, avar: yes, it was removed from testing quite some time ago. mostly because a lack of tuits on my side. 00:27
Juerd rafl: Ah - is this a structural problem? 00:53
glion quit 03:57
Auzon hands glion a slash
Need one of those? ;)
glion waves and feints
what i really wanted was a shell... 03:58
Auzon Oh. Well, I have two, but I don't think they'd help you much ;)
glion makes a necklace of shells 03:59
glion i wouldn't mind a peek at one of your shells, i'll show you mine 04:00
Auzon Uh... I'm not sure how to reply to that ^_^'
glion probably you have some interesting stuff on your system, 04:01
but i might need a graphic interface to see it
otoh you might have some great coding, but then it would be
on CPAN. So what do I need a shell for? 04:02
Auzon I'm not a /great/ coder. But I do have an interesting project (at least to me) 04:03
glion what are you up to? 04:03
Auzon One of those browser-based game things 04:04
College drained a lot of progress, but...
glion cool, i'm working on a perl module for multitrack recording and mixing 04:05
Auzon Wow, that's neat. :)
glion the audio processing engine is already out there, and already 04:06
Auzon A whole lot more interesting than my stuff. Though I am trying to figure out how to make water "flow"...
glion a perl interface to that processing engine
My main aim has been to have fun while picking up some higher level 04:07
concepts.
Auzon Have you heard of Pidgin?
glion reaches for his browser
Auzon Open source instant messaging client
Formerly Gaim
glion how is IM different from IRC 04:08
Auzon IM is the general term. IRC is a specific protocol
IM is a broad category, including AIM, IRC, Yahoo, MSN, Jabber, etc 04:09
glion oh, like sending bits of graphics, html etc.
Auzon I use it for just text, but yeah
I've wanted to make a Perl binding for libpurple (the library that Pidgin is built off of)
glion If it will help, you can look at Audio::Ecasound which 04:10
interfaces Ecasound (written in C) with perl.
Auzon Sadly, I don't know C :-/ 04:11
Pidgin has a (poorly maintained) Perl scripting engine internally, which is why I thought it'd be easy
glion Can you talk to it through STDIN
It's own copy of a perl interpreter? 04:12
Auzon Embedded
glion yup
Auzon I imagine I could write a program to eval things, but it wouldn't be headless... 04:13
glion what's wrong with having a head?
Auzon I want to use the backend to make a multiprotocol IM bot 04:14
glion If you look around, you might find an example that suites you 04:15
close enough to copy
Auzon Good idea
I'll put it on my to do list ;)
glion Right now I am bringing up module, my firsts, starting to write tests 04:16
I am proud.
Auzon I need to get in the habit of writing more and better tests
glion The perl build environment is substantially furnished
Auzon Right now, my tests require that they are run in a certain order :-/ 04:17
glion At these point is easier that I put them in 01_sometest.t than anywhere else
Auzon How many tests do you have? 04:18
glion Uh, a couple 04:18
I'm on the add-as-you-go plan
Auzon My project (the game) is at 271 tests with that plan, and they're a tangled mess 04:19
271 or so
glion Like right now, I'm not reading my cnofiguration file, so make a test for whether it reads
Holy rat piss!
Auzon Well, it does have a forum-like system integrated, and each action within the game has its own file. 04:20
glion I could see how some kinds of testing could be as complex and tangled as the pgorams they test 04:21
Auzon Well, I use a database (MySQL), and the problem is that the database is assumed to be in a certain state. 04:22
glion A browser game with a forum
For multiple users
Auzon Yeah
I tried to keep as much as possible out of the web interface, so I can test the objects themselves easier 04:23
glion I am dumping my data structures to YAML, and will use git to manage switching between each snapshot of system state (i.e. slider positions). Users will be able to branch their projects and develop on different branches, even merge, all at no cost to me. 04:26
Auzon Neat
glion pounds his check and bellows
Auzon I have a SVN repository for my project (and other code, too)
glion Git is my first experience with version control and my life will never be the same 04:27
I have to train myself not to clog up directories with old versions. 04:28
Auzon One of the players likes to make Greasemonkey scripts for similar games. So I made an interface for scripts that returns output in JSON. It can't do much, but it should be enough to prevent people to try to parse the site's HTML due to laziness :P
and version control is amazing
I can't imagine coding without it
glion I can, filenames like e87, but then I was running as a single procedural script. 04:29
Auzon Actually, for a while, I had some projects that I emulated a repository
I find it hard to return to those projects now :P
glion There is a way of learning to think mathematically, but that often develops after thickets of code are already in place 04:32
Auzon What do you mean?
Auzon needs a faster computer to run virtual machines on 04:33
glion I have procedural code, introducing a couple of classes to get rid of conditional code. 04:34
The thinking mathematically part involves map, grep, hashes and other constructs to somehow self assemble in my mind as a solution to a problem 04:35
Now expanding to include objects and classes
Auzon map and grep are so useful. I was forced to program in Java for CS125 this semester. It was terrible. 04:36
glion I've been sorting through all my variables... I haven't seen my cute little tk user interface pop up for such a long time, <<sniff>>
Auzon Tk, hm?
I want to get Wx working with PAR. That'd be pretty nice. 04:37
glion I might switch over to another widget set after I retire. 04:38
tk was my first, and fairly straightforward to learn.
Auzon I haven't chosen one yet, so I imagine I can still be free from them
I've played with all though
glion HOw difficult, do you guess to port from Tk to Wx 04:39
?
Auzon It depends on how your code is laid out
But I don't think you could stick a layer between them, for instance 04:40
glion For the moment I am focusing on the non GUI aspects. I'll let others stand on my gigantic shoulders. 04:41
Auzon It's hard to change code when it's heavily involved with the UI 04:42
Anyway, I shall talk with you later.
glion I have about 700 lines of it. I used classes UI UI::Text UI::Graphical to get rid of about 30 lines of conditional code such as refreshwindow if $gui 04:43
One widget, the one-per-track widget is 300 lines! 04:44
So I am not eager to make big changes there, as you can imagine, even tho I think my code is well organized. 04:45
Bye!
Nice talking to you.
glion ll 05:11
moritz_ we just lost exp_evalbot and the svn bot for a minute... 09:43
they'll be back as soon as the server is up again
wie bekomme ich denn zu einem String die Unicode-Namen? 09:44
moritz_ sorry, wrong channel 09:49
pmurias fglock: what are there resons for auto_deref being used instead of emiting FETCH calls? 15:06
fglock pmurias: I think it is no longer used 15:07
pmurias fglock: it is 15:08
fglock looking
pmurias $foo.method is turned into $foo.FETCH.method 15:10
fglock pmurias: it's a shortcut for checking if the object is a container 15:12
there are other ways to do that 15:13
pmurias food&
fglock VAR() uses " exists $container->{_dispatch_VAR} "
it works the same 15:14
$foo.FETCH.method will not work, but
VAR($foo).FETCH.method should work 15:15
pmurias fglock: in sub foo($arg) {VAR($arg)};foo(1); what is $arg? 15:18
fglock not sure what you mean, but it's a Scalar 15:19
$arg is a "my" variable inside foo() 15:20
it's .BIND to "1"
pmurias fglock: so it would be an Int 15:21
not a Scalar
fglock yes, it depends how you look at it 15:22
pmurias by .BIND you mean :=? 15:23
fglock yes 15:24
pmurias pugs: my $var1;say VAR($var1) === VAR($var2);
exp_evalbot OUTPUT[*** ␤ Unexpected ");"␤ expecting "::"␤ Variable "$var2" requires predeclaration or explicit package name␤ at /tmp/ZuFEUEcbm0 line 1, column 38␤]
pmurias in sub foo($arg is rw) {...};my $var;foo($var);is the container in $arg $var or a proxy object? 15:26
fglock in kp6, $arg and $var point to a common "container cell" 15:29
in a sense, they are both "proxy objects" 15:30
pmurias fglock: aren't they the same container? 15:31
fglock no, they are different containers, but they are currently "bind" to each other
$a := $b; $b := $c # $a no longer binds to $b 15:32
moritz_ > 15:33
> Für Hilfe besten Dank!
>
> Gruß Berthold
lambdabot <stdin>: hGetLine: end of file
Illegal character ''\188''
at "􏿽xBCr" (column 3)
Illegal character ''\159''
at "􏿽x9F" (column 5)
<stdin>: hGetLine: end of file
moritz_ sorry
dammned copy & paste
pmurias fglock: "$var := 1;say VAR($var).isa(::Int)" prints 1? 15:37
fglock no, VAR($var) isa Scalar 15:37
(but I think it's broken in kp6) 15:38
pmurias fglock: i'm not sure, but i get your point of view
pugs: $var := 1;say VAR($var).isa(::Int) 15:39
exp_evalbot OUTPUT[*** ␤ Unexpected " :="␤ expecting "::"␤ Variable "$var" requires predeclaration or explicit package name␤ at /tmp/IDj64ENXah line 1, column 5␤]
fglock pmurias: pugs says it is
pmurias pugs: my $var := 1;say VAR($var).isa(::Int)
exp_evalbot OUTPUT[1␤]
pmurias fglock: i think it's important to have it done correctly 15:45
fglock pmurias: yes, it is - I misunderstood the spec 15:46
pmurias i hate when ispell doesn't accept a word and suggest the word it dosn 15:48
't accept as a suggestion
s/as a suggestion//
pmurias fglock: the reason i asked about auto_deref is that is limits method dispatch caching 15:49
fglock isn't it mutability that limits caching? 15:51
pmurias fglock: my assumption is that one dosn't modify the classes much at runtime 15:53
fglock I mean, container mutability 15:54
hmm - you mean to FETCH before dispatch?
pmurias yes
fglock I think that's possible, yes 15:55
pmurias we would have to use DISPATCH_VAR then 15:57
* wouldn't
fglock I don't know if it covers all the cases - it needs some experiments 15:59
fglock pmurias: you could try it out 16:07
pmurias i could try it out later(i'll try it for Perl5Cached) 16:09
fglock ok :) 16:11
[particle] fglock: this code is causing perl6 pain: my $testing_started; END { say $testing_started } 16:43
No scope found for PAST::Var '$testing_started'
seems it can't do a lexical lookup from the END block for a var defined outside it. same problem for BEGIN? 16:44
fglock the problem is related, yes - but END is a bit simpler
[particle] true
fglock because the lexical scope actually exists 16:45
you need a way to make the ":outer" thing
doesn't parrot support END blocks natively? 16:46
[particle] no 16:46
fglock with something like :end
you can fix that by emitting the END blocks as if they were inner subroutines, and then just call these subroutines at the actual END 16:47
[particle] could each end block have a different :outer? or do they all share the top level block in the compunit?
fglock each block belongs to the lexical scope where it was defined, I think 16:48
so it's actually an inner subroutine
[particle] hrmm, that's not how perl6 handles it now
it runs the main code, then executes everything registered in @?END_BLOCKS 16:49
fglock assuming the lexical scope is not destroyed
hmm - maybe it's actually a closure
[particle] ill look at S0*
fglock this makes more sense
moritz_ that's why I just wanted to say
gbacon fglock: was just wondering whether it was closing over free vars
fglock it seems so 16:50
[particle] the very end of S04 has something to say about that 16:50
gbacon sign of maturity: in Perl 5, everything was a scalar; now, everything's a closure :-)
fglock you can test it in Perl5, it should work just the same
[particle] >perl -e"my $c='hi'; END{print $c}" 16:51
hi
moritz_ aye, that's a closure 16:52
pugs_svn r19230 | pmurias++ | [kp-perl5cached] removed DISPATCH_VAR calls, not respecting auto_fetch FETCHing before every method call (too often) 17:09
r19230 | pmurias++ | some tests fail
g For Lord Grace! take a look at www.montoya.in 18:18
sinners!
it´s a joke)
i´m joking
lel 18:19
i laugh alone!
www.montoya.in
Auzon Am I alone when I wonder "What the heck?" 18:20
moritz_ no 18:21
moritz_ I'd just call it "spam" 18:21
Auzon Yes, but so bizarre spam.
[particle] fglock: ping 20:07
fglock [particle]: pong 20:08
[particle] phone call?
Limbic_Region . o O ( there is a "phone home" joke in there somewhere )
PerlJam the cabal is always at home where ever they are. 20:09
[particle] there's a cabal?
Auzon perlcabal.org ? 20:10
lambdabot Title: Perl6 Community Development Server
agjal good night 20:11
Auzon See you 20:12
gbacon @botsnack 21:34
lambdabot :)
Auzon lambdabot: good bot 21:35
Blwood ?eval sum (1..5) 23:15
?eval [~] sum (1..5)
:( 23:16
Auzon pugs: sum(1..5)
exp_evalbot RESULT[15]
Auzon kp6: sum(1..5)
exp_evalbot r19230: OUTPUT[syntax error at position 3, line 1 column 3:␤sum(1..5␤ ^ HERE␤]
Blwood oh okey thx :)
Auzon ;)
mp6: sum(1..6)
Blwood pugs: (*) (1..5)
exp_evalbot OUTPUT[*** ␤ Unexpected "("␤ expecting operator␤ at /tmp/hYjkJJJAG3 line 1, column 5␤]
Auzon (Dunno if there is a mp6)
Blwood i can't remember the right syntax to use (*) :( ?
Auzon pugs: [*] 1..5 23:17
exp_evalbot RESULT[120]
Blwood ahhh
thank you :)
Auzon No problem. I like playing with the bots
pugs: .say for ^4
exp_evalbot OUTPUT[0␤1␤2␤3␤]
Blwood pugs: split //, ([*] 1..5) 23:18
exp_evalbot OUTPUT[*** Null patterns are invalid; use <?null> or an empty string instead␤ at /tmp/KiwMzY7UeT line 1, column 7-9␤]
Blwood argh
Auzon Pugs is more complete, but (from what I've seen) kp6 is more likely to be compiled to Parrot 23:19
Blwood okay :) i'm just playing with the syntax at the moment, comparing it to haskell
Auzon I don't know Haskell :-/ 23:20
Blwood worth learning :)
Auzon I suppose, especially since my webhost has Haskell support
Blwood do you know what's the syntax to use split// in perl6 ? i can't find it :( 23:21
Auzon pugs: split /<?null>/, [*] 1 ..^5 23:22
pugs: split '', [*] 1 ..^5
Dunno if those are it 23:23
exp_evalbot RESULT[("2", "4")]
Auzon They are ^_^
Blwood pugs: split '', [*] 1..5
exp_evalbot RESULT[("1", "2", "0")]
Blwood oh cool thx :)
Auzon Or... maybe this too?
pugs: ([*] 1..5).split('')
exp_evalbot RESULT[("",)] 23:24
Auzon Nope.
Blwood pugs: [+] split '', [*] 1..10
amazing :)
exp_evalbot RESULT[27.0]
Auzon Yeah, I'm pretty happy about the reduce operator 23:25
pugs: (1 .. 5) ~~ (5 .. 1)
exp_evalbot RESULT[Bool::False]
Blwood :)
Auzon False? O.o
I guess.
Blwood that's strange 23:26
Auzon pugs: (1 .. 5) => (5 .. 1)
exp_evalbot RESULT[((1, 2, 3, 4, 5) => ())]
Auzon Hm, nope.
Oh right
pugs: 1,2 Z 3,4
exp_evalbot RESULT[((1, 3), (2, 4))]
Auzon I'm trying to make a hash by zipping two lists 23:27
Blwood ah the zipWith in haskell :)
Auzon pugs: 1, 2 Z*Z 3,4 23:28
exp_evalbot RESULT[((1, Inf, 3),)]
Auzon I don't think that's what I meant 23:29
pugs: ...
exp_evalbot OUTPUT[*** Cannot use this control structure outside a 'routine' structure␤ at /tmp/b9DEVDyxgR line 1, column 1 - line 2, column 1␤]
Auzon Oh dang
pugs: $s = sub {...}; $s->();
exp_evalbot OUTPUT[*** ␤ Unexpected " ="␤ expecting "::"␤ Variable "$s" requires predeclaration or explicit package name␤ at /tmp/jy2AcQRMTV line 1, column 3␤]
Auzon pugs: % 1,2 Z 3,4 23:30
exp_evalbot OUTPUT[*** ␤ Unexpected " 1"␤ expecting "::"␤ at /tmp/n4xgVYIOVW line 1, column 2␤]
Auzon That should work but doesn't
Blwood maybe not implemented yet ? 23:31
Auzon pugs: [=>] 1,2 Z 3,4
Probably
exp_evalbot RESULT[((1, 3), (2, 4))]
Auzon pugs: {1,2 Z 3,4}
exp_evalbot RESULT[((1, 3), (2, 4))]
Auzon Still nope.
pugs: %hash = (a => 1, b => 0, c => 0); print $hash<a> 23:32
exp_evalbot OUTPUT[*** ␤ Unexpected " ="␤ expecting "::"␤ Variable "%hash" requires predeclaration or explicit package name␤ at /tmp/hu9IDrXXQC line 1, column 6␤]
Auzon pugs: %hash = {a => 1, b => 0, c => 0}; print $hash<a>
exp_evalbot OUTPUT[*** ␤ Unexpected " ="␤ expecting "::"␤ Variable "%hash" requires predeclaration or explicit package name␤ at /tmp/jUZq5dtwzq line 1, column 6␤]
Auzon pugs: my %hash = {a => 1, b => 0, c => 0}; print $hash<a>
exp_evalbot OUTPUT[*** ␤ Unexpected "<a"␤ expecting "::"␤ Variable "$hash" requires predeclaration or explicit package name␤ at /tmp/QmULzPkz8m line 1, column 49␤]
Auzon pugs: my %hash = {a => 1, b => 0, c => 0}; print $hash{'a'}
exp_evalbot OUTPUT[*** ␤ Unexpected "{'"␤ expecting "::"␤ Variable "$hash" requires predeclaration or explicit package name␤ at /tmp/hvffiSOhJU line 1, column 49␤]
Auzon pugs: my %hash = {a => 1, b => 0, c => 0}; print %hash{'a'}
exp_evalbot OUTPUT[1]
Auzon pugs: my %hash = {a => 1, b => 0, c => 0}; print %hash<a>
exp_evalbot OUTPUT[1]
Auzon pugs: my %hash = {a => 1, b => 0, c => 0}; print %hash<a b c>
exp_evalbot OUTPUT[100]
Auzon That's pretty neat, but I still want to zip two lists to make a hash 23:33
pugs: (1..10) + (11..20) 23:37
exp_evalbot RESULT[20.0]
Auzon pugs: (1..10) ^+ (11..20)
exp_evalbot RESULT[(10 ^ (1, 2, 3, 4, 5, 6, 7, 8, 9, 10))]
Auzon :-/
Tene pugs: my @a = 1..3; my @b = 'a'..'c'; my %h = zip @a, @b; %h
exp_evalbot RESULT[{("1" => "a"), ("2" => "b"), ("3" => "c")}]
Tene like that?
Auzon Yep
Tene That what you expected it would be like? 23:38
Auzon I think so
{1 => 'a', 2 => 'b', 3 => 'c'}
I dunno if the parens matter up there
Tene They don't.
Auzon Ah 23:39
I like that ^_^
Tene () flatten in list context, [] don't.
Auzon pugs: my $version is const = '5.10.0'; $version.subst(/0/, 1); 23:41
exp_evalbot RESULT[\"5.11.0"]
Auzon But, I told it to be constant. :-/
pugs: constant $version = '5.10.0'; $version.subst(/0/, 1); 23:42
exp_evalbot RESULT[\"5.11.0"]
Auzon pugs: const $version = '5.10.0'; $version.subst(/0/, 1);
exp_evalbot OUTPUT[*** ␤ Unexpected " ="␤ expecting "::"␤ Variable "$version" requires predeclaration or explicit package name␤ at /tmp/H659RaBBZk line 1, column 15␤]
Auzon So constant is there, just not working
Auzon pugs: "Hi there".say.say 23:48
exp_evalbot OUTPUT[Hi there␤1␤]
Tene Auzon: pugs doesn't respect 'constant' 23:52
it parses it and ignores it.
Auzon That's what I figured ;)
Tene pugs: my $foo is squibble = 'abcd' 23:53
exp_evalbot RESULT[\"abcd"]
ispy_ I don't think it respects 'exists' either, unless I'm doing something wrong :)
Auzon pugs: constant $foo = "ham";
exp_evalbot RESULT[\"ham"]
Auzon pugs: squibble $foo = "ham";
exp_evalbot OUTPUT[*** ␤ Unexpected " ="␤ expecting "::"␤ Variable "$foo" requires predeclaration or explicit package name␤ at /tmp/uaWacBHj5w line 1, column 14␤]
Tene my 23:55
Auzon Yeah, but it took constant. 23:56