From: "Jeff Henrikson" <jehenrik@yahoo.com>
To: <caml-list@inria.fr>
Subject: [Caml-list] camlp4: LIST1 construct on record patterns
Date: Sun, 13 Jan 2002 00:38:49 -0500 [thread overview]
Message-ID: <005401c19bf4$93d638a0$0b01a8c0@mit.edu> (raw)
In camlp4, I don't seem to be able to break apart a record pattern in any way. I must not understand how to use LIST1 properly:
let try_extend _ =
let cons = "Bogus" in
let test_label_eq = Grammar.Entry.find expr "test_label_eq" in
let lbl_expr_list = Grammar.Entry.find expr "lbl_expr_list" in
EXTEND
expr: LEVEL "simple"
[ [ $cons$; "{"; memb = LIST1 lbl_expr_list SEP ";" ; "}" ->
<:expr<{$list:memb$}>> ] ]
;
END;;
try_extend "junk";;
...
[ [ $cons$; "{"; memb = LIST1 reenter SEP ";" ; "}" ->
<:expr<{$list:memb$}>> ] ]
^^^^
;
END;;
This expression has type Obj.t list but is here used with type
(MLast.patt * MLast.expr) list
Isn't an Obj.t a completely opaque meaningless entity?
Substituting test_label_eq for lbl_expr_list makes no difference. I got those identifiers by running:
Grammar.Entry.print expr;;
which doesn't tell me the meaning of test_label_eq, and
Grammar.Entry.print (Grammar.Entry.find expr "test_label_eq");;
doesn't tell me anything either. Do I just have to go read the source code to know their meaning? I would have except I guess it
doesn't come default now that camlp4 is part of ocaml.
Jeff Henrikson
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next reply other threads:[~2002-01-13 5:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-13 5:38 Jeff Henrikson [this message]
2002-01-13 13:48 ` Daniel de Rauglaudre
2002-01-14 2:17 ` Jeff Henrikson
2002-01-14 2:49 ` Jeff Henrikson
2002-01-14 5:10 ` Daniel de Rauglaudre
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='005401c19bf4$93d638a0$0b01a8c0@mit.edu' \
--to=jehenrik@yahoo.com \
--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