Name

copy — Copy a Hecl value.

Synopsis

cd value

Description

The copy command makes a deep copy of a Hecl value, whereas normally, Hecl variables contain references.

Example

hecl> set foo 1
set bee $foo
set bop [copy $foo]
incr $foo
puts "foo is $foo"
puts "bee is $bee"
puts "bop is $bop"
	

Produces:

foo is 2
bee is 2
bop is 1