ruby picture

RCR 164: New interpreter switch

Submitted by legacy (Wed Oct 29 10:10:59 UTC 2003)

Abstract

This is a legacy RCR from Ruby Garden, submitted by martindemello. Matz has declared these RCRs obsolete, and asked that their authors resubmit them in the new format.

It'd be useful to have a switch for the following implicit loop:

while gets
  print $_.instance_eval {
    ...
  }
end
This would help the common use pattern of piping a series of lines through a script.

Old:

ruby -n -e 'puts $_.split.join(" | ")'
ruby -p -e '$_ = $_.split.join(" | ") + "n"'

New:

ruby -j -e 'split.join(" | ") + "n"'
ruby -j -e 'split.join(" | ").newline"'

Problem

(RCR imported from old format)

Proposal

Analysis

(RCR imported from old format)

Implementation

(RCR imported from old format)
ruby picture
Comments Current voting


Strongly opposed 0
Opposed 0
Neutral 0
In favor 0
Strongly advocate 0
ruby picture
If you have registered at RCRchive, you may now sign in below. If you have not registered, you may sign up for a username and password. Registering enables you to submit new RCRs, and vote and leave comments on existing RCRs.
Your username:
Your password:

ruby picture

Powered by .