coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: roconnor AT theorem.ca
- To: Coq User <coquser AT googlemail.com>
- Cc: coq-club AT pauillac.inria.fr
- Subject: Re: [Coq-Club] Empty Record Field
- Date: Mon, 17 Aug 2009 22:17:32 -0400 (EDT)
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
On Mon, 17 Aug 2009, Coq User wrote:
How can I initial a Race with a 'null' laneTwo? Also how might I test for
'null' given an instance of the
Race record.
Require Import String.
Record Sprinter := {name:string}.
Record Track := {laneOne:Sprinter;laneTwo:Sprinter}.
Definition Race:Track := (Build_Track (Build_Sprinter "Fast") (null??)).
You cannot without explicitly using something like the option type:
Record Track := {laneOne:option Sprinter;laneTwo:option Sprinter}.
Definition Race:Track := (Build_Track (Some (Build_Sprinter "Fast")) None).
--
Russell O'Connor <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
- [Coq-Club] Empty Record Field, Coq User
- Re: [Coq-Club] Empty Record Field, roconnor
- Re: [Coq-Club] Empty Record Field, Coq User
- Re: [Coq-Club] Empty Record Field, roconnor
Archive powered by MhonArc 2.6.16.