Constrained genericity: Difference between revisions

Content added Content deleted
(→‎{{header|TXR}}: Solution using define-struct-clause.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 1,723: Line 1,723:
=={{header|Wren}}==
=={{header|Wren}}==
Wren is dynamically typed and so any constraint on class instantiation can only be checked at run time.
Wren is dynamically typed and so any constraint on class instantiation can only be checked at run time.
<syntaxhighlight lang="ecmascript">// abstract class
<syntaxhighlight lang="wren">// abstract class
class Eatable {
class Eatable {
eat() { /* override in child class */ }
eat() { /* override in child class */ }