Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: P2P Golf: MoleSter

by jonadab (Parson)
on Dec 17, 2004 at 15:16 UTC ( [id://415657]=note: print w/replies, xml ) Need Help??


in reply to Re^2: P2P Golf: MoleSter
in thread P2P Golf: MoleSter

Wow, there's clearly an evil genius at work here. The splice is an interesting conversion. The thing you're doing calling i in sub h is slightly confusing, but I understand what you're doing with the regex in the while loop now, which I somehow missed last night. (Oh, I see, it was front-anchored in last night's version. That must be one of the bug fixes. But, won't $` contain the separating slash now? I'm still confused there. You've golfed it beyond my ability to follow it.)

  • You've still got the verbose if/else blocks in sub t. Converting to the trinary operator saves, if my calculations are correct, three strokes if you have to parenthesize the middle part, five if you don't. Am I missing something?
  • You've gone back to the three-argument open; is that one of the bug fixes you mentioned? I thought it was semantically the same... and if not, I want to understand the difference for reasons that have nothing to do with obfuscation, golf, or P2P.
  • I assume the delete is a bugfix, to purge dead peers from %k entirely. Makes sense.
  • The space after the comma in sub g, what's the reasoning behind that?

Replies are listed 'Best First'.
Re^2: P2P Golf: MoleSter
by dragonchild (Archbishop) on Dec 17, 2004 at 15:57 UTC
    In some semblance of order ...
    • The thing you're doing calling i in sub h is slightly confusing, ...

      I have no idea why any of the functions do what they do. I just make them do it with less characters.

    • The regex changes aren't a bugfix, and there is no separating slash in the first two values - they are separated by a space (which is why \S* is better than .*?). So, no slash in $`.
    • I hadn't gotten to the trinary yet - it probably does save a few characters. I'll do it and put out an update.
    • If you have open(F, ">$_[1]") and the filename is ">foo" ... what happens? The 3-arg open() prevents that.
    • The space after the comma is my eyes glazing over. I'll fix it in the update with the trinary.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      If you have open(F, ">$_[1]") and the filename is ">foo" ... what happens? The 3-arg open() prevents that.

      Gah. I keep forgetting that *nix allows shell metacharacters in filenames. (I cut my teeth on PC-DOS 3.3, which, whatever its other problems, does not permit that particular form of lossage.)


      "In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://415657]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found