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: 465 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello,
I found out a different behavior of directive load and the Load Object
command in the File menu.
Usually, if I want to use a compiled file, I do:
Load Object from the File menu
open NameOfObject.
The Load Object command creates a line with the directive load, for example
#load "C:\work\programs.cmo";; - I thought that if I type the same text on
my own, I will get the same behavior. Unfortunately, I do not. So if I type
the following lines,
#load "C:\work\programs.cmo";;
open Programs;;
I get - Unbound module Programs. However, if I do it by using Load Object
command it works.
If I do,
#directory "C:\work";;
#load "programs.cmo";;
open Programs;;
it works OK, and I can use functions from programs.cmo file.
Why doesn't the load directive work if I use a full path name of a file? An
why does it work when I use the Load Object command?
Thank you for your response.
David Baca
The text was updated successfully, but these errors were encountered:
Hello,
I found out a different behavior of directive load and the Load Object
command in the File menu.
Usually, if I want to use a compiled file, I do:
Load Object from the File menu
open NameOfObject.
The Load Object command creates a line with the directive load, for example
#load "C:\work\programs.cmo";; - I thought that if I type the same text on
my own, I will get the same behavior. Unfortunately, I do not. So if I type
the following lines,
#load "C:\work\programs.cmo";;
open Programs;;
I get - Unbound module Programs. However, if I do it by using Load Object
command it works.
If I do,
#directory "C:\work";;
#load "programs.cmo";;
open Programs;;
it works OK, and I can use functions from programs.cmo file.
Why doesn't the load directive work if I use a full path name of a file? An
why does it work when I use the Load Object command?
#load works with a full path. However, "open Programs" fails because
it doesn't find the programs.cmi file in the current search path:
#load doesn't add an entry to this path, this is done by a distinct
directive #directory.
The reason it works with the "Load Object" menu entry is that the
latter changes the current working directory to the directory
containing the loaded .cmo file. The current working directory is
always in the search path, hence "open Programs" finds programs.cmi
all right.
I'm not sure whether this is a side-effect of the file selection
dialog, or whether the OCaml GUI does it on purpose to try to be
helpful, but I agree this behavior is a bit confusing.
Original bug ID: 465
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello,
I found out a different behavior of directive load and the Load Object
command in the File menu.
Usually, if I want to use a compiled file, I do:
Load Object from the File menu
open NameOfObject.
The Load Object command creates a line with the directive load, for example
my own, I will get the same behavior. Unfortunately, I do not. So if I type
the following lines,
#load "C:\work\programs.cmo";;
open Programs;;
I get - Unbound module Programs. However, if I do it by using Load Object
command it works.
If I do,
#directory "C:\work";;
#load "programs.cmo";;
open Programs;;
it works OK, and I can use functions from programs.cmo file.
Why doesn't the load directive work if I use a full path name of a file? An
why does it work when I use the Load Object command?
Thank you for your response.
David Baca
The text was updated successfully, but these errors were encountered: