Anonymous user
Compound data type: Difference between revisions
m
→{{header|Crystal}}: i missed that the task specifically calls for a Point data type
(→{{header|D}}: add crystal implementation with a link to the language reference) |
m (→{{header|Crystal}}: i missed that the task specifically calls for a Point data type) |
||
Line 520:
Crystal's structs work very similarly to objects, but are allocated on the stack instead of the heap, and passed by value instead of by reference. More potential caveats are noted in the [https://crystal-lang.org/reference/syntax_and_semantics/structs.html language reference].
<lang ruby>struct
getter
getter
def initialize(@
end
end
puts
=={{header|D}}==
|