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

problem with lazy value #3649

Closed
vicuna opened this issue Sep 10, 2002 · 1 comment
Closed

problem with lazy value #3649

vicuna opened this issue Sep 10, 2002 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Sep 10, 2002

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

Bug description

Full_Name: Vanicat Rémi
Version: ocaml 3.06
OS:
Submission from: ca-bordeaux-13-4.abo.wanadoo.fr (80.8.85.4)

Hello

Lazy.force is said (in the documentation) to alway return the same value when
evaluted on the same lazy value. This is not true anymore in the current
implementation :

let a = lazy (lazy (failwith "lazy"));;

val a : 'a lazy_t lazy_t =

Lazy.force a;;

  • : '_a lazy_t =

Lazy.force a;;

  • : '_a lazy_t =

Gc.full_major ();;

  • : unit = ()

Lazy.force a;;

Exception: Failure "lazy".

This seem to come from the shortcut made by the gc on forward tag.

@vicuna
Copy link
Author

vicuna commented Sep 18, 2002

Comment author: administrator

Lazy.force is said (in the documentation) to alway return the same value when
evaluted on the same lazy value. This is not true anymore in the current
implementation :

let a = lazy (lazy (failwith "lazy"));;

val a : 'a lazy_t lazy_t =

Lazy.force a;;

  • : '_a lazy_t =

Lazy.force a;;

  • : '_a lazy_t =

Gc.full_major ();;

  • : unit = ()

Lazy.force a;;

Exception: Failure "lazy".

Fixed in the working version (3.06+3).
-- Damien

@vicuna vicuna closed this as completed Sep 18, 2002
@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