From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA31130 for caml-red; Sun, 2 Jul 2000 19:14:05 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA04737 for ; Sat, 1 Jul 2000 21:21:02 +0200 (MET DST) Received: from mail.mimuw.edu.pl (pd43.warszawa.ppp.tpnet.pl [212.160.55.43]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e61JKrD00220 for ; Sat, 1 Jul 2000 21:20:54 +0200 (MET DST) Received: (from news@localhost) by mail.mimuw.edu.pl (PLD/8.9.3) id VAA06860 for caml-list@inria.fr; Sat, 1 Jul 2000 21:21:40 +0200 X-Authentication-Warning: qrnik.knm.org.pl: news set sender to qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) using -f From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) Subject: Re: How to cleanly encode "quasi-constants"? Date: 1 Jul 2000 19:21:37 GMT Organization: Klub Nieszkodliwych =?iso-8859-2?Q?Manjak=F3w?= Message-ID: X-Trace: qrnik.knm.org.pl 962479297 6858 127.0.0.1 (1 Jul 2000 19:21:37 GMT) X-Complaints-To: news@qrnik.knm.org.pl NNTP-Posting-Date: 1 Jul 2000 19:21:37 GMT User-Agent: slrn/0.9.6.2 (Linux) To: caml-list@inria.fr Sender: weis@pauillac.inria.fr 01 Jul 2000 20:01:54 +1000, Julian Assange pisze: > The revised syntax is cleaner, but drops so much syntactic sugar, > that the language becomes ugly due to its verbosity. It introduces many []'s. Haskell uses optional layout to avoid that many brackets and separators. In OCaml it would look similar to this: value rec iter_row f row = do List.iter (fun (_, fi) -> match row_field_repr fi with Rpresent (Some ty) -> f ty Reither _ tl _ -> List.iter f tl _ -> ()) row.row_fields return (match (repr row.row_more).desc with Tvariant row -> iter_row f row Tvar -> do Misc.may (fun (_, l) -> List.iter f l) row.row_name return (List.iter f row.row_bound) _ -> assert False) -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E- ^^ W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t QRCZAK 5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-