ruby picture

RCR 171: All language constructs to return something useful

Submitted by legacy (Fri Nov 28 08:11:11 UTC 2003)

Abstract

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

For language consistency, i think all constructions like class, module, def, etc should return some useful values. For class it can be class object, mor module -- module. So constructions like:

str =
will be possible.

Problem

(RCR imported from old format)

Proposal

Analysis

(RCR imported from old format)

Implementation

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

sorry for wrong escaping in post (dmiceman, 2003-11-28 00:28:07)

code should look like:

str=<<END
  class aaa<br />
  end<br />
END
klass = eval str
klass.new

doen's it work now? (, 2003-11-28 04:25:24)

class Klass end
returns Klass at the moment. for end, returns niln do..end returns.. wel, return, and def..end returns nil. BTW def..end should at least return a symbol of the method.. someone with an rcr please?

scoop (transami, 2003-11-29 06:30:08)

It's already been noted and should be taken care of in future. I don't know why they don't do ASAP. Its an easy fix w/ no back code breaking as far as I know. Perhaps they still debate symbol or method.

I agree, that as many constructs as possible return useful results. Just no good reason not to.


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 .