caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] suggestion for record pattern matching and construction
@ 2003-09-10 18:52 Eric C. Cooper
  2003-09-10 23:19 ` Olivier Andrieu
  2003-09-11 13:49 ` [Caml-list] FreeBSD + lablglut + thread: bug or not bug Christophe Raffalli
  0 siblings, 2 replies; 15+ messages in thread
From: Eric C. Cooper @ 2003-09-10 18:52 UTC (permalink / raw)
  To: caml-list

I find that I am often writing code like
    { field1 = field1; field2 = field2; field3 = field3 }
when matching and constructing records.  I guess it's because thinking
up good names for the record fields is nontrivial and having similar
but different names for the bindings just bothers me.

How about allowing syntax like that used for labels:
    { ~field1; ~field2; ~field3 }
would expand into the above, in both pattern matching and construction
contexts.

This is orthogonal to (and I think much simpler than) omitting some
fields via "..." notation.

-- 
Eric C. Cooper          e c c @ c m u . e d u

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-09-22 12:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-10 18:52 [Caml-list] suggestion for record pattern matching and construction Eric C. Cooper
2003-09-10 23:19 ` Olivier Andrieu
2003-09-14 19:32   ` brogoff
2003-09-11 13:49 ` [Caml-list] FreeBSD + lablglut + thread: bug or not bug Christophe Raffalli
2003-09-11 14:25   ` Christophe Raffalli
2003-09-11 14:30   ` Gerd Stolpmann
2003-09-11 15:11     ` Christophe Raffalli
2003-09-11 15:23       ` Gerd Stolpmann
2003-09-11 17:33   ` Issac Trotts
2003-09-11 20:01     ` Christophe Raffalli
2003-09-11 20:09     ` Christophe Raffalli
2003-09-11 20:38       ` Issac Trotts
2003-09-12  5:57       ` Christophe Raffalli
2003-09-12  6:34         ` Gerd Stolpmann
2003-09-22 12:16         ` Christophe Raffalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).