#perl
24 December 2007
Total 13 pages. You are browsing page 2/13.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
18:07 <****> $foo=reference to bar;
18:07 <****> do_foo_to_execute_bar;
18:08 <****>(@args);
18:08 <****> $foo = \sub { ...}
18:08 <****> &$foo
18:08 <****> El_Che: why the \ ?
18:08 <****> and why the missing ; ?
18:09 <****> $foo = \sub { ...} would be silly
18:09 <****> because this freaking azerty keyboard
18:09 <****> thanks. I know what to look for now .. couldn't find any ref to this in the primers yet.
18:09 <****> perldoc perlref
18:09 <****> perlbot tutorial
18:09 <****> http://perlmonks.org/index.pl?node=Tutorials | http://perl.com/cs/user/query/q/6?id_topic=74 | http://learn.perl.org/ | http://books.perl.org/onlinebooks | http://perl-begin.org/tutorials/ | http://learn.perl.org/library/beginning_perl/
18:09 <****> perlsub too, presumably
18:09 <****> see the perlmonks tutorial - reference quick refence is a good one
18:12 <****> Khisanth: may not be silly. in fact meant to store in arrays. but as I assume that calling subs indirectly from array elements is akin to calling from variables, I reduced complexity for sake of asking.
18:14 <****> Bushmills: there aren't a lot of good reasons for creating a referenced to a code reference
18:14 <****> Khisanth: can we assume that I have a good reason?
18:14 <****> No.
18:14 <****> hardly
18:14 <****> Does anybody know how the function "keys" works in the perl C source ? (Not how it works in perl) .. I was wondering how I could explain how keys works if somebody in another language wanted to implement it for a Sorted List data storage object.
18:15 <****> a ref to a code ref? i'd be interested in a reason for that
18:15 <****> thinking of doing this in perl: http://forthfreak.net/jsforth.js and http://www.forthfreak.net/bashforth
18:15 <****> you can have an array (more often a hash) of coderefs
18:15 <****> Soul: easiest way to find out is to go and look
18:15 <****> anno-: I do that
18:16 <****> anno-: well, I write subs that return a ref to a coderef
18:16 <****>${func()}(...)
18:17 <****> yeah, but you're insane
18:17 <****> anno-: in the bashforth file, this does it:
18:17 <****> function next { w=${m[ip++]} ${m[w++]} }
18:19 <****> anno-: the jsforth file uses it here:
18:19 <****> function nextprimitive() { x[w]() ; } function nexthilevel() { w = x[w] ; x[m[w]]() ; }
18:20 <****> anno-: if you wish, I can detail the operation, but I'd prefer to do that in a /query
18:20 <****> okay, when emulating a forth interpreter it just might make sense
18:22 <****> i'm not convinced it's the best way (but not suffciently interested to check)
18:23 <****> neither am I, but I don't know any alternative for perl yet
18:23 <****> cascaded/nested if else ... sequences are a definite no-no
18:24 <****> switch! :)
18:24 <****> my guts feeling is, the "next function" should be a coderef
18:24 <****> hrm wait cascade
18:24 <****> you can cascade switches, i bet
18:25 <****> well yesh but you don't replace cascaded if-else with A switch
18:25 <****> Khisanth: different syntax, same result or principle
18:26 <****> Khisanth: true
18:27 <****> a "dispatch table" can be (part of) the solution
18:27 <****> solution meaning un-cascading
18:28 <****> an array with refs to subs is what I imagine a dispatch table to be
18:28 <****> Bushmills: a coderef is already a scalar
18:28 <****> Bushmills: there's no point taking a ref to it. that's just a ref to a ref :)
18:28 <****> right. array or hash
18:28 <****> a dispatch table with sub refs and predicates to test if the subs should be called or not, maybe
18:30 <****> looks like DarthFredd has succumbed to the power of the Dark Side
18:30 <****> again?
18:30 <****> he keeps disconnecting... it's annoying
18:31 <****> the Dark Side is a little more than merely annoying
18:36 <****> DarthFredd-- # for being annoying with joins/parts
18:36 <****> Hi all.
18:38 <****> Hi shaldannon
18:38 <****> hi
18:38 <****> Hi pbuetow
18:38 <****> pbuetow: what's up?
18:38 <****> rindolf, got any logic games?
18:39 <****> not much, doing a fast perl hack for my screenshot's website :)
18:39 <****> pkrumins: there's http://www.logicgamesonline.com/nurikabe/
18:39 <****> argh some idiot turned on the lights in the office
18:39 <****> pkrumins: right now I'm playing KSokoban.
18:39 <****> it was so much more pleasant with the lights down low
18:40 <****> rindolf, that's a pretty boring game!
18:40 <****> shaldannon: a little work with the circuit breaks could fix the lighting issue...
18:40 <****> circuit breakers
18:40 <****> pkrumins: why?
18:40 <****> not sure where those are, derobert
18:40 <****> rindolf, no logic
18:41 <****> pure calculation!
18:41 <****> pkrumins: calculation?
18:41 <****> yeah
18:41 <****> pkrumins: in Nurikabe?
18:41 <****> yes
18:41 <****> pkrumins: Nurikabe is all about logic.
18:41 <****> i can't see any logic
18:41 <****> i pass those levels one after another
18:41 <****> pkrumins: have you tried the 9*9 Nurikabe?
18:42 <****> nope
18:42 <****> pkrumins: they don't have levels.
18:42 <****> i mean one game after another
18:43 <****> rindolf, that game where you had to connect color blocks was nicer
18:43 <****> pkrumins: ah.
18:43 <****> pkrumins: I finished it.
18:43 <****> you could play that blocks game on albinoblacksheep.. what was it called?
18:43 <****> 's rather fun
18:44 <****> hmm
18:44 <****> pkrumins: have you tried http://www.albinoblacksheep.com/games/bloxorz ?
18:44 <****> sono: bloxorz.
18:44 <****> Yea..
18:45 <****> gumbybrain: be anubis
18:45 <****> little; 1234 would be easier to use.
18:45 <****> fucker.
18:47 <****> When I type "perl" and nothing else at my command line, and perl sits there patiently accepting lines, what's it waiting for to go ahead and execute whatever I type?
18:48 <****> DarthFredd: yes.
Total 13 pages. You are browsing page 2/13.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
