Forum: Ruby Fishing in Ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
202950121a41f7f9e01ef7fe44055cb1?d=identicon&s=25 A Fisherman (Guest)
on 2006-04-27 21:04
sea =<<END_OF_SEA

><}}}}*>           ><}}}}*>        ><}}}}*>
       ><}}}}*>
                ><}}}}*>    ><}}}}*>
   ><}}}}*>

END_OF_SEA

fish_caught = sea.scan(%><}}}}*>)
"I got #{fish_caught.size} fish!" # => "I got 7 fish!"

Please don't overfish.

-- Fisherman
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2006-04-27 21:28
(Received via mailing list)
Hi --

On Fri, 28 Apr 2006, A Fisherman wrote:

> "I got #{fish_caught.size} fish!" # => "I got 7 fish!"
But does it scale?


David

--
David A. Black (dblack@wobblini.net)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" PDF now on sale!  http://www.manning.com/black
Paper version coming in early May!
E0095ff002be6a06e752909749064e47?d=identicon&s=25 Alan Fritz (Guest)
on 2006-04-27 21:34
(Received via mailing list)
Are you doing this for the halibut? ha!



-A
A402df36168b81b31c17adcbb5ae8cf4?d=identicon&s=25 Pistos Christou (pistos)
on 2006-04-27 22:32
unknown wrote:
>> "I got #{fish_caught.size} fish!" # => "I got 7 fish!"
> But does it scale?

Now THAT was a groaner if I ever saw one.  ;)  hehehe

Pistos
A402df36168b81b31c17adcbb5ae8cf4?d=identicon&s=25 Pistos Christou (pistos)
on 2006-04-27 22:35
A Fisherman wrote:
> fish_caught = sea.scan(%><}}}}*>)

Just as I thought: Your code doesn't run.  ;)

irb(main):088:0> fish_caught = sea.scan(%><}}}}*>)
irb(main):089:1"

This works, though:

fish_caught = sea.scan("><}}}}*>")

/me supposes he's taking this far too seriously...

Pistos
202950121a41f7f9e01ef7fe44055cb1?d=identicon&s=25 A Fisherman (Guest)
on 2006-04-27 22:54
Pistos Christou wrote:
> A Fisherman wrote:
>> fish_caught = sea.scan(%><}}}}*>)
>
> Just as I thought: Your code doesn't run.  ;)
>
> irb(main):088:0> fish_caught = sea.scan(%><}}}}*>)
> irb(main):089:1"
>
> This works, though:
>
> fish_caught = sea.scan("><}}}}*>")
>
> /me supposes he's taking this far too seriously...


IRB can't handle the fish. It runs reel well using regular ruby command.
E0095ff002be6a06e752909749064e47?d=identicon&s=25 Alan Fritz (Guest)
on 2006-04-27 23:05
(Received via mailing list)
so your not fishing off the same platform?
Bd0203dc8478deb969d72f52e741bd4f?d=identicon&s=25 Daniel Baird (Guest)
on 2006-04-28 01:01
(Received via mailing list)
Perhaps the original poster was just fishing for compliments.
2c51fec8183a5d21c4e11b430beabb47?d=identicon&s=25 Patrick Hurley (Guest)
on 2006-04-28 01:31
(Received via mailing list)
On 4/27/06, Daniel Baird <danielbaird@gmail.com> wrote:
> > To: ruby-talk ML
> > >
> > Posted via http://www.ruby-forum.com/.
>
I believe he was trolling

pth
A402df36168b81b31c17adcbb5ae8cf4?d=identicon&s=25 Pistos Christou (pistos)
on 2006-04-28 02:24
A Fisherman wrote:
> Pistos Christou wrote:
>>> fish_caught = sea.scan(%><}}}}*>)
> IRB can't handle the fish. It runs reel well using regular ruby command.

Can someone explain what's happening with the line, then?  Is it using
the '>' as the delimiter?  So it's sort of chopping off the "snout" of
each fish?

Pistos
This topic is locked and can not be replied to.