CORE - Alternative Variable Substitution

On 2 Ιούν, 14:29, Peter Z. [email protected] wrote:

Can I change this functionality with a C-level extension, but without
altering the ruby source?

Definitely no (for MRI, at least).
[…] (technical elaborations).

Which means that it’s effectively impossible to alter the behaviour,
without altering the source-code.

Thanks for the information.

.

On 1 , 11:13, Ilias L. [email protected] wrote:

ruby 1.9

prints “#{name} has 5 credits”

Is there any existent library (ruby 1.9) availbale, which enables an
alternative variable substitution, like e.g.

prints “&name has 5 credits”

class VarTester
$g = “global”
@@c = “class”

def f
“function”
end

def initialize
@i = “instance”
l = “local”
puts “#$g #@@c #@i #l #f #{l} #{f}”
end
end

VarTester.new

#=> global class instance #l #f local function

Related Issue:

Unify Variable Expansion within Strings

.