Navigation Menu

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

#trace and simultaneous recursive definitions #8007

Closed
vicuna opened this issue Feb 5, 2003 · 2 comments
Closed

#trace and simultaneous recursive definitions #8007

vicuna opened this issue Feb 5, 2003 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 5, 2003

Original bug ID: 1535
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

It appears that only the first of a set of simultaneously-defined recursive
definitions is "#trace"able. This is counter-intuitive.

Chris Dutchyn
cdutchyn@cs.ubc.ca

(* Test Cases )
(
(1) demonstrates the problem *)

let rec even x = if 0=x then true else odd (x-1)

and odd x = if 0=x then false else even (x-1);;

val even : int -> bool =
val odd : int -> bool =

#trace even;;

even is now traced.

#trace odd;;

odd is not a function.

even;;

-: int -> bool =

odd;;

  • : int -> bool =

(* (2) it is the rec that causes the failure *)

let rec foo x = x+1

and bar x = x+1;;

val foo : int -> int =
val bar : int -> int =

#trace bar;;

bar is not a function.

(* (3) without rec works *)

let foo1 x = x+2

and bar1 x = x-2;;

#trace bar1;;

bar1 is now traced.

(* end test cases *)

@vicuna
Copy link
Author

vicuna commented Feb 6, 2003

Comment author: administrator

It appears that only the first of a set of simultaneously-defined recursive
definitions is "#trace"able. This is counter-intuitive.

It's a bug in OCaml 3.06, actually. It is fixed in the working
sources. Just let me know if you'd like a patch for that.

Regards,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Feb 6, 2003

Comment author: administrator

See #3554. Fixed 2002-11-18 by XL.

@vicuna vicuna closed this as completed Feb 6, 2003
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant