Browse thread
Re: How to cleanly encode "quasi-constants"?
- qrczak@k...
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | qrczak@k... |
| Subject: | Re: How to cleanly encode "quasi-constants"? |
01 Jul 2000 20:01:54 +1000, Julian Assange <proff@iq.org> 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-