From: Steve Stevenson <steve@cs.clemson.edu>
To: caml-list@inria.fr
Subject: Help --- type checker and I agree to disagree...
Date: Fri, 24 Sep 1999 09:08:58 -0400 (EDT) [thread overview]
Message-ID: <14315.30432.686941.63376@merlin.cs.clemson.edu> (raw)
I'm still experimenting with the deque I wrote about some time
ago. Now the type checker and I can't come to an agreement in one
module which we agree on the exact same construct somewhere else.
What am I not seeing?
Best regards,
steve
-----
Steve (really "D. E.") Stevenson Assoc Prof
Department of Computer Science, Clemson, (864)656-5880.mabell
Support V&V mailing list: ivandv@cs.clemson.edu
------------------------------------------------------------
The code:
open Objdeque
(* See below *)
open Rtnppxsem
(* Has type definitions for (NoOp,Nil) *)
let definemacro c_inp = c_inp#hpop
let gpm c_inp =
let nulltype = ((NoOp,Nil):semantics) in
let h_out = new objdeque nulltype in
while true do
let a = c_inp#hpop in
match a with
| (Definiendum, Nil) -> (definemacro c_inp); ()
| _ -> (h_out#tpush a); ()
done;
h_out
------------------------------------------------------------
The disagreement
(merlin)[ORTN] 49) ocamlc -c test.ml
File "test.ml", line 8, characters 27-35:
This expression has type
Rtnppxsem.semantics = Rtnppxsem.action * Rtnppxsem.semantics_data
but is here used with type 'a Objdnode.objdnode option as 'a
(merlin)[ORTN] 50)
------------------------------------------------------------
Objdeque:
(merlin)[ORTN] 46) ocamlc -c -i objdnode.ml
class ['a] objdnode :
'a ->
object
val mutable aft : 'a objdnode option
val node : 'a
method aftof : unit -> 'a objdnode option
method nodeof : unit -> 'a
method setaft : 'a objdnode option -> unit
end
(merlin)[ORTN] 48) ocamlc -c -i objdeque.ml
exception Empty
class ['a] objdeque :
'a ->
object
constraint 'a = ('a Objdnode.objdnode as 'b) option
val mutable hd : 'a
val mutable tl : 'a Objdnode.objdnode as 'c
method connect : 'a objdeque -> unit
method convert : 'a list
method createreader : 'a objdeque
method gethead : 'a list
method head : unit -> 'a
method hpop : 'a
method hpush : 'a -> unit
method hread : 'a
method iter_p : (int -> 'a -> unit) -> unit
method tail : unit -> ('a Objdnode.objdnode as 'd)
method tpush : 'a -> unit
end
reply other threads:[~1999-09-24 16:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14315.30432.686941.63376@merlin.cs.clemson.edu \
--to=steve@cs.clemson.edu \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox