You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1677 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi all,
Maybe my imagination is too limited here. But I can't think of any
reason why replacing the first expression with the second expression
should cause my program to segfault.
match sync_framerate with
_ -> ();
match sync_framerate with
_ -> ()
| _ -> ();
I'm working on a mixed c++/caml class project. It's a bit annoying to
compile (requires ocamlgsl). But if you untar this, it has a bytecode
executabe already built at "gawalker/caml_src/a.out".
Then, if the sync_framerate argument is supplied I want to set a global
variable to its contents.
match sync_framerate with
None -> ()
| Some b -> compensate_framerate := b;
This works when sync_framerate is provided, but segfaults when it is
absent. (Oddly, putting the match inside a subfunction and calling that
solves the problem.)
The bytecode and native code executables have the same behaviour for me.
Sorry for the English-only; sadly, I'm a monoglot,
Cheers,
--Ryan
The text was updated successfully, but these errors were encountered:
Original bug ID: 1677
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi all,
Maybe my imagination is too limited here. But I can't think of any
reason why replacing the first expression with the second expression
should cause my program to segfault.
match sync_framerate with
_ -> ();
match sync_framerate with
_ -> ()
| _ -> ();
I'm working on a mixed c++/caml class project. It's a bit annoying to
compile (requires ocamlgsl). But if you untar this, it has a bytecode
executabe already built at "gawalker/caml_src/a.out".
http://www.ffh.us/ryan/temp/gawalker.tgz
What I want to do is have an boolean optional argument to the function
"runworld". Thus:
let runworld
?(sync_framerate)
?(draw=true) ?(plot=false) ?(ticks= -1)
?(closewin=true)
walker display = ...
Then, if the sync_framerate argument is supplied I want to set a global
variable to its contents.
match sync_framerate with
None -> ()
| Some b -> compensate_framerate := b;
This works when sync_framerate is provided, but segfaults when it is
absent. (Oddly, putting the match inside a subfunction and calling that
solves the problem.)
The bytecode and native code executables have the same behaviour for me.
Sorry for the English-only; sadly, I'm a monoglot,
Cheers,
--Ryan
The text was updated successfully, but these errors were encountered: