Type detection: Difference between revisions

Content added Content deleted
(→‎{{header|Wren}}: Updated - output didn't even match input before!)
Line 2,242: Line 2,242:
=={{header|Wren}}==
=={{header|Wren}}==
{{libheader|Wren-fmt}}
{{libheader|Wren-fmt}}
<lang ecmascript>import "/fmt" for Fmt
<lang ecmascript>import "./fmt" for Fmt


var showType = Fn.new { |obj|
var showType = Fn.new { |obj|
System.print("%(Fmt.s(10, obj)) has type %(Fmt.q(obj.type))")
Fmt.print("$10n has type $q", obj, obj.type)
}
}


Line 2,258: Line 2,258:
{1: first} has type "Map"
{1: first} has type "Map"
true has type "Bool"
true has type "Bool"
null has type "Null"
1..6 has type "Range"
Rosetta has type "String"
Rosetta has type "String"
</pre>
</pre>