Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > On #<, #> and -w (void context warnings)

Reply
Thread Tools

On #<, #> and -w (void context warnings)

 
 
Eero Saynatkari
Guest
Posts: n/a
 
      09-30-2006
--xtx0sNU5lZ46KfgK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello!=20

Time for the weekly syntax analysis thingy. ruby -w causes
this code to issue a warning:

# warning: useless use of < in void context
'/tmp/foo' < "Some text here"=20
=20
Same goes for #>. The problem, somewhat obviously, goes away
when the same expression is used in a conditional position.

I was thinking about it and there is really no way to avoid
this assuming that the warning is considered to be useful
for those instances where someone accidentally uses this
type of an expression outside a conditional. =20

--xtx0sNU5lZ46KfgK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFHgiU7Nh7RM4TrhIRAmIJAKCqufMSgK/lusthgdBTrSQ9OQexxwCfYOy2
TEBL0NKsw+qvc63HqEe/04Y=
=PHOe
-----END PGP SIGNATURE-----

--xtx0sNU5lZ46KfgK--

 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      09-30-2006
Eero Saynatkari wrote:
> Hello!
>
> Time for the weekly syntax analysis thingy. ruby -w causes
> this code to issue a warning:
>
> # warning: useless use of < in void context
> '/tmp/foo' < "Some text here"
>
> Same goes for #>. The problem, somewhat obviously, goes away
> when the same expression is used in a conditional position.
>
> I was thinking about it and there is really no way to avoid
> this assuming that the warning is considered to be useful
> for those instances where someone accidentally uses this
> type of an expression outside a conditional.


This is a quite accurate summary.

Kind regards

robert
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spring context refering to application context Jani Tiainen Java 3 08-27-2007 07:24 AM
return HttpStatusCode.ServiceUnavailable in the context.context.Response.StatusCode (Http response code 503) Flip Rayner ASP .Net 1 01-23-2007 06:35 AM
How to retrieve a session Bean in the Context in a class with the Context reference asd Java 1 11-09-2006 05:00 PM
Strange Context Error: Context 0x197ee0 is disconnected in VS 2005 =?Utf-8?B?U3VuU21pbGU=?= ASP .Net 0 01-10-2006 03:59 PM
Context.Items vs Context.Handler (passing values between pages) VS_NET_DEV ASP .Net 2 05-25-2004 01:16 PM



Advertisments