From: chain_lube@... Date: 2004-07-17T21:07:12+09:00 Subject: Re: Functional Ruby (Re: Why I don't use Ruby.) Mikael Brockman wrote in message news:<87llhx2hec.fsf@phubuh.org>... > In Scheme, sum would be: > > (define (sum xs) > (if (null? xs) > 0 > (+ (car xs) (sum (cdr xs))))) Or in Bigloo with pattern-matching: (define (sum xs) (match-case xs (() 0) ((?h ???t) (+ h (sum t))))) or with types: (define (sum::obj xs::pair) (match-case xs (() 0) ((?h ???t) (+ h (sum t))))) Bigloo its pattern-matching facility is as sophisticated as OCaml its one. Fensterbrett