Editing Topic: RCR228 Project: RCR | RCRchive home

RCR 228: Uniform meta-access while parsing Ruby code

submitted by itsme213 on Thu Mar 11 2004 11:34:50 AM -0800

Status: withdrawn


Abstract

Ruby's exposing of self within a class body is one of its powerful extensibility features. This RCR proposes similar uniform access via self to methods, parameters, constants, etc. to allow extensibility of all of these elements.

Problem

Facilities such as attr rely on methods on Class being invoked within a class body with self = current_class. By POLS, similar access should be provided to methods defined on syntactic elements such as:

Proposal

Generalize class facilities like attr (in the same spirit as SAX events) by doing the following:

Analysis

Implementation

If I knew more of how the Ruby grammar was being implemented I could probably suggest something.


Back to RCRchive.


RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog