From: Matthew Kerwin Date: 2013-03-12T05:35:13+09:00 Subject: Re: Confusion with empty block printing --bcaec554dbc8f3b68404d7ac1b15 Content-Type: text/plain; charset=ISO-8859-1 On 12 March 2013 03:29, Love U Ruby wrote: > Hans Mackowiak wrote in post #1101107: > > > > normally ruby functions when you add a block to them they ignored them > > silency > > I am thinking when IRB sees that `print {}.class`, Is there any chance > to treat it as (print {}).class #=> NilClass ? > I'm pretty sure you want: print( {}.class ) But that's not what you asked for. This is pretty simple syntax stuff. -- Matthew Kerwin, B.Sc (CompSci) (Hons) http://matthew.kerwin.net.au/ --bcaec554dbc8f3b68404d7ac1b15 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 1= 2 March 2013 03:29, Love U Ruby <lists@ruby-forum.com> wr= ote:
Hans Mackowiak wrote in post #1101107:


> normally ruby functions when you add a block to them they ignored them=
> silency

I am thinking when IRB sees that `print {}.class`, Is there any chanc= e
to treat it as (print {}).class #=3D> NilClass ?

I'm pretty sure you w= ant:=A0=A0 print( {}.class )
But that&#= 39;s not what you asked for.

This is pretty simple syntax stuff.

--
=A0 Matthew Kerwin, B.Sc (CompSci) (Hons)
= =A0 http://matt= hew.kerwin.net.au/
--bcaec554dbc8f3b68404d7ac1b15--