Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000465OCamlOCaml generalpublic2001-07-31 12:432001-08-08 17:18
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000465: load under ocamlwin.exe
DescriptionHello,
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

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0002324)
administrator (administrator)
2001-08-08 16:33

> 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

(0002325)
administrator (administrator)
2001-08-08 17:18

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

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker