flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 245: Print value of custom type
Idiom # 245: Print value of custom type
See
programming-idioms.org
:
Code
say x # it usually helps if x's type redefined 'as_string'
What are effects?
Running Example
ex245 is T1 is a := 42 b := "Hello" x := T1 say x # output is much more useful if as_string is redefined T2 is a := 42 b := "Hello" redef as_string => "T $a $b" x := T2 say x
What are effects?
next: Idiom # 246: Count distinct elements