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

load under ocamlwin.exe #2877

Closed
vicuna opened this issue Jul 31, 2001 · 2 comments
Closed

load under ocamlwin.exe #2877

vicuna opened this issue Jul 31, 2001 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 31, 2001

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

@vicuna
Copy link
Author

vicuna commented Aug 8, 2001

Comment author: administrator

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.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Aug 8, 2001

Comment author: administrator

Not a bug per se, but behavior of toplevel GUI is suprising.

@vicuna vicuna closed this as completed Aug 8, 2001
@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