Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#perl

14 October 2007


Total 42 pages. You are browsing page 4/42.

First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last

02:35 <****> how else would they indicate success or failure of tests except through some standard means?
02:36 <****> the problem arises when i, as a testing framework, would like to manage the TAP or other reporting means
02:36 <****> anno-, Khisanth: but is there defined somewhere what's done first, &foo or &bar, and while that order be the same after updating perl from version x.y.z to x.y.++z? for (;;&foo) {} continue {&bar}
02:36 <****> jdv79, You're a testing framework?
02:36 <****> s/there/it/
02:36 <****> this is troublesome when random Test:: modules i would like to use just spit out TAP
02:37 <****> yes, i am a walking talking testing monolith!
02:37 <****> jdv79: You.. don't make sense.
02:37 * apeiron tests jdv79.
02:37 <****> falcon78: Deparse!
02:37 <****> jdv79: What exactly does "manage TAP" mean?
02:37 <****> deparse: for (;;&foo) {} continue {&bar}
02:37 <****> Khisanth: Error: syntax error at (eval 213) line 1, near "} continue"
02:37 <****> jdv79: so, instead of the standard means they use to indicate test status, you want them to use some other standard means that
02:37 <****> see that is not even valid syntax :)
02:37 <****> jdv79: which would be..?
02:38 <****> return value, exceptions - like in regular programming
02:38 <****> and calling a sub as &foo is crap
02:38 <****> Khisanth, But I want to circumvent prototypes
02:38 <****> !
02:38 <****> apeiron, MEOW
02:38 <****> pkrumins, meow
02:38 <****> apeiron: but I am not refering to prototypes !
02:38 <****> pkrumins, am got travel tomorrow!
02:39 <****> jdv79: Override ok =]
02:39 <****> Khisanth, Ahh.
02:39 <****> not all Test:: modules have that function
02:39 <****> they emit TAP in various places
02:39 <****> jdv79: exceptions wouldn't work, and you are suggesting every module be re-designed to have some (standard) switch that tells it to return values (which is not practical for every test) instead of just print
02:39 <****> I said &foo not &foo()
02:39 <****> jdv79: instead of you adapting to the interface at hand
02:40 <****> you think trapping STDOUT or ERR, whichever it is, is good practice?
02:40 <****> I think it's better practice than deciding that everything is wrong because of your specialty application
02:41 <****> I'm questioning the current way because it makes little sense if taken out of the narrow context that people seem to have about its
02:41 <****> *it
02:41 <****> Y'know, usually, when people don't like / can't use what's available, they write something new. :)
02:41 <****> jdv79: you are suggesting generalizing something for a purpose that is rarely used
02:41 <****> generalizing many, not necessarily associated modules
02:42 <****> who would know why its done this way?
02:43 * CPAN upload: Gungho-0.08012 by DMAKI
02:44 <****> jdv79: are you asking for the specific name of a person? or is this some rhetorical question?
02:44 <****> i'm asking where to get the answer.
02:45 <****> apeiron, where you travel tomorrow?
02:45 <****> pkrumins, Wisconsin for work.
02:46 <****> apeiron++
02:46 <****> jdv79: isn't the answer obvious? the modules are modeled on Test::Harness's expectations
02:46 <****> kspath, Hm?
02:46 <****> apeiron: for having work/job
02:46 <****> kspath, Ahhh.
02:47 <****> apeiron++
02:48 <****> 500+ lurkers?
02:48 <****> kspath, Approximately.
02:49 <****> I look at the lurkers as a vote for whatever project it is
02:49 <****> it just seems odd that would be the design decision although in the perl world i suppose it makes sense.
02:49 <****> jdv79: perl universe
02:49 <****> kspath, err? Most of the people here aren't related to $work. :)
02:53 <****> THERE ARE NO LURKERS HERE
02:53 <****> anno-: you said continue works fine with a for loop, but i get a syntax error on executing 'for (;;) {sleep 2} continue {print "foo\n"}'
02:54 <****> yes, i saw that too. apparently, the (;;) form doesn't accept continue. for ( @list ) { ... does
02:55 <****> even more reason to make infinite loops while (1) { ... }
02:55 <****> deparse: for(;;){}
02:55 <****> Khisanth: while (1) { (); }
02:56 <****> the only reason for "continue" is so the for (;;) semantics can be described as a while loop
02:59 <****> looks like i have to really use 'while (1)' instead of 'for (;;)', which i'd prefer, but i need a working continue block for readability reasons
03:00 <****> 'for (;;)' is a bit of a red flag; it says the programmer isn't comfortable with Perl
03:01 <****> look for other C-style programming practices and fix them
03:05 <****> the thing after the second ; *is* the continue... well, statement
03:05 <****> for(;;do {}) { } :)
03:05 <****> deparse: for (my $i = 0; $i < 10; $i++) { print $i }
03:05 <****> Somni: for ((my $i = 0); ($i < 10); (++$i)) { print($i); }
03:06 <****> Somni: i like the fact that there is no value in for (;;), so there can't be anything be done with it. having a value like 1 anywhere could mean that software could take it literal and put that value into memory and even could load it into registers to check it at runtime. apparently perl doesn't do that in this case, but i don't trust values where i don't have anything to rate
03:07 <****> falcon78: Perl doesn't, this is how we write infinite loops
03:07 <****> the continue is not even relevant unless you need to use next
03:07 <****> falcon78: this is an idiom; as much as you'd like to carry things over from another language for whatever rationale you can come up with, it's best to use a language's idioms instead of enforcing your own
03:08 <****> and as the deparse indicates even if you write it as for(;;) perl turns it into while(1) anyway
03:08 <****> well, not necessarily turns it into a while, just that the opcodes for an infinite loop are indistinguishable between the two
03:09 <****> and since 'while (1)' is the most common, that's what it guesses you wrote
03:09 <****> Khisanth: redo, next, last, i have all of it in my loop ;) so to my example it really is relevant ;)
03:09 <****> redo and last are irrelevant when talking about continue
03:10 <****> indeed, i just wanted to mention that i'm using every single kind of loop control in there ;)
03:10 <****> that in itself is pretty suspect..
03:10 <****> I don't think I have ever seriously used redo
03:10 <****> I just discovered {redo} the other day
03:11 <****> (when mauke was showing it off)
03:11 <****> When in Rome, and all that.
03:11 <****> and when it's an infinite loop, redo is the same as next
03:11 <****> well, I guess you do have a continue block
03:11 <****> Somni: strange, my code is full of redos
03:11 <****> but I think I've used continue blocks all of twice
03:14 <****> eval: @a = (1..4); 2*@a
03:14 <****> jettero: 8
03:15 <****> that answer is expected. It seems like it should be a scalar, but is it * that makes it a scalar? is it because the lhs is a scalar?
03:15 <****> how do you multiply an array?
03:15 <****> yeah, I get that...
03:16 <****> then that's it; the * imposes scalar context on both operands
03:16 <****> 2 *^ @a? :)
03:16 <****> so it's * being a scalar operator that makes 2*@a definitely a scalar?
03:16 <****> eval: @a = (1..4); @a * @a
03:16 <****> Somni: 16
03:16 <****> ahh


Total 42 pages. You are browsing page 4/42.

First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo