From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>
To: Matthieu Wipliez <mwipliez@yahoo.fr>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: Re : [Caml-list] changing labels on ocamlgraph edges
Date: Thu, 12 Mar 2009 15:38:32 +0100 [thread overview]
Message-ID: <49B91E68.5020508@lri.fr> (raw)
In-Reply-To: <366870.61081.qm@web27007.mail.ukl.yahoo.com>
Matthieu Wipliez wrote:
> I'm also using ocamlgraph with labels of type t = bool ref * int option
> And I found that for add_edge to have the proper behavior, I need to replace the default add_edge with this one:
> let add_edge graph v1 v2 = add_edge_e graph (v1, (ref false, None), v2)
>
> Otherwise all edges share the same reference (created in "default"), and changing the boolean for an edge changes it for all edges...
>
May be we should document add_edge more carefully, so that it is clear
that it makes use of the default edge label, and that, consequently,
this label is shared among all edges created with add_edge
Indeed you have to use add_edge_e instead to avoid sharing
--
Jean-Christophe
next prev parent reply other threads:[~2009-03-12 14:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 1:47 Alexy Khrabrov
2009-03-12 7:55 ` [Caml-list] " Julien SIGNOLES
2009-03-12 12:47 ` Re : " Matthieu Wipliez
2009-03-12 14:38 ` Jean-Christophe Filliatre [this message]
2009-03-13 0:10 ` Alexy Khrabrov
2009-03-13 10:53 ` Re : " Matthieu Wipliez
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=49B91E68.5020508@lri.fr \
--to=jean-christophe.filliatre@lri.fr \
--cc=caml-list@inria.fr \
--cc=mwipliez@yahoo.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;
as well as URLs for NNTP newsgroup(s).