USING: kernel accessors prettyprint namespaces math math.constants syntax ; IN: scratchpad TUPLE: rectangle { width float } { height float } ; : ( -- rectangle ) rectangle new ; TUPLE: circle { radius float } ; : ( -- circle ) circle new ; GENERIC: area M: rectangle area ( rectangle -- x ) dup width>> swap height>> * ; M: circle area ( circle -- x ) radius>> dup * pi * ; 100 >>width 50 >>height area . 10 >>radius area .