Project

General

Profile

Actions

Feature #8365

closed

Make variables objects

Added by Anonymous over 9 years ago. Updated over 6 years ago.

Status:
Feedback
Priority:
Normal
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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0