Project

General

Profile

ActionsLike0

Feature #8365

closed

Make variables objects

Added by Anonymous about 12 years ago. Updated over 8 years ago.

Status:
Feedback
Target version:
-
[ruby-core:54765]

Description

While refactoring a wiki article about Ruby, I found this anonymous proposal:

"How about making variables objects. And assignment is the default message you send to the variable object (not the underlying reference). anintvar 5, now the variable "anintvar" is a reference to the constant integer 5. And since variables are objects, you can do some neat things like subclass variables. It would be a mixed world of static variable typing and dynamic. Use the appropriate one for a given scenario. You could also do linear casting. exm.
integer new anintvar 5
char new acharvar anintvar

Variable types and the reference object they point to can be 2 different types. But the variable decides how to do the casting not the object referenced. "anintvar" and "acharvar" reference the same object."

I am pasting this anonymous proposal here in original full length, before I rewrite it to a more concise form in that wiki page.

Updated by matz (Yukihiro Matsumoto) about 12 years ago

  • Status changed from Open to Feedback
  • Assignee set to matz (Yukihiro Matsumoto)
ActionsLike0

Also available in: Atom PDF