Jump to content

Pointers and references: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
imported>Acediast
(→‎{{header|COBOL}}: Syntax highlighting.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 2,168:
 
The following example illustrates the difference by passing both value and reference type parameters to a function. Note that in Wren parameters are always passed by value.
<syntaxhighlight lang="ecmascriptwren">// This function takes a string (behaves like a value type) and a list (reference type).
// The value and the reference are copied to their respective parameters.
var f = Fn.new { |s, l|
9,482

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.