Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camldebug + install_printer #7962

Open
vicuna opened this Issue Nov 30, 2002 · 0 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Nov 30, 2002

Original bug ID: 1487
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: tools (ocaml{lex,yacc,dep,debug,...})

Bug description

avec ocaml 3.06 cygwin+
camldebug sous emacs(21.1.1) +
des printers speciaux pour mes types,
j'ai un probleme.

Je declare des types dans un fichier f1.ml, je les utilise dans des
fonctions, certaines de f1.ml, d'autres de f2.ml. Je cree et installe les
printers correspondants dans camldebug. Ils fonctionnent tres bien dans le
fichier ou ne sont pas declares les types, mais ne fonctionnent pas dans
f1.ml.

Exemple:

f1.ml: ------------------------------

type foo = { foo_content: string; }

let bar foo =
foo.foo_content^foo.foo_content

f2.ml: ------------------------------
let gnat foo =
String.uppercase foo.F1.foo_content

let _ =
let foo = {F1.foo_content="foo"} in
print_string (gnat foo);
print_newline ();
print_string (F1.bar foo);
print_newline ()

printer.ml: -------------------------
open Format
let foo fmt foo = print_string ("<<"^foo.F1.foo_content^">>");

$ ocamlc -g -o test f1.ml f2.ml
$ ocamlc -c printer.ml

M-x camldebug test
(ocd) load_printer "printer.cmo"
(ocd) install_printer Printer.foo

si je fais "print foo" dans F2.gnat, j'obtiens bien:
(ocd) print foo
foo : F1.foo = <>

Par contre, dans F1.bar, j'obtiens:
(ocd) print foo
foo : foo = {foo_content = "foo"}

@vicuna vicuna added the tools label Mar 14, 2019

@nojb nojb added the ocamldebug label Mar 15, 2019

@vicuna vicuna added the feature-wish label Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.