Paste: testing

Author: mrjbq7
Mode: factor
Date: Wed, 13 Apr 2011 01:06:44
Plain Text |
USING: accessors kernel math math.constants
math.functions prettyprint ;
IN: shapes

TUPLE: circle radius ;
TUPLE: rectangle width height ;

GENERIC: area ( shape -- area )
M: circle area radius>> sq pi * ;
M: rectangle area [ width>> ] [ height>> ] bi * ;

rectangle new 10 >>width 20 >>height area .

New Annotation

Summary:
Author:
Mode:
Body: