Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3757

Re: Must be my bug, but it looks like Ruby's could it be?

From 7stud -- <bbxx789_05ss@yahoo.com>
Newsgroups comp.lang.ruby
Subject Re: Must be my bug, but it looks like Ruby's could it be?
Date 2011-04-30 17:06 -0500
Organization Service de news de lacave.net
Message-ID <43ecaf91e8d0892d69f43684ff203e27@ruby-forum.com> (permalink)
References <35a326a2-4c63-430b-b4b8-8aa7e15873d2@l18g2000yql.googlegroups.com>

Show all headers | View raw


RichardOnRails wrote in post #995908:
> I know my Subject line looks like heresy in this newsgroup, but I
> can't figure out how I'm screwing up in this bug.
>
> I posted the program at http://www.pastie.org/1849430
> It reads in a little control data, which is displayed at
> http://www.pastie.org/1849434
>
> The program reads in the control data and stores it in hash containing
> two hashes in this case, which represents the two pseudo-hashes in the
> control data.
>
> My problem is conflicting output by the statements numbered 155 & 156:
>     puts %[%d\t%s => %s] % [num+=1, key, value]

I know about ruby's % substitutions, but I can't decipher that line--you 
have obfuscated the code very well!  Not a good thing.   I would write 
that line as:

puts "%d\t%s => %s" % [num+=1, key, val]

lol.  You are using the % shortcut for %Q and you are using [] as the 
delimiter.  I have only one thing to say: horrible code writing.

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Must be my bug, but it looks like Ruby's ... could it be? RichardOnRails <RichardDummyMailbox58407@USComputerGurus.com> - 2011-04-29 21:24 -0700
  Re: Must be my bug, but it looks like Ruby's could it be? 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-30 17:06 -0500
    Re: Must be my bug, but it looks like Ruby's could it be? RichardOnRails <RichardDummyMailbox58407@USComputerGurus.com> - 2011-05-08 20:33 -0700
      Re: Must be my bug, but it looks like Ruby's could it be? 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-09 14:54 -0500
        Re: Must be my bug, but it looks like Ruby's could it be? RichardOnRails <RichardDummyMailbox58407@USComputerGurus.com> - 2011-05-11 10:37 -0700

csiph-web