Re: Namespace trouble

2004-05-20 Thread Malcolm Wallace
Jorge Adriano Aires [EMAIL PROTECTED] writes:

 I have the following structure:
 
  MyProgram/A.hs
  MyProgram/Aux/B.hs
  MyProgram/Aux/C.hs

You have already received replies to your question, so let me make a
different point.  If you ever intend your program to work on Windows,
do not use Aux as a file or directory name!  The libraries mailing
list has some recent experience of this.  (Apparently Aux is a
reserved filename on Windows and you get strange behaviour if you
try to use it for anything else.)

Regards,
Malcolm
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Namespace trouble

2004-05-20 Thread Jorge Adriano Aires

 Jorge Adriano Aires [EMAIL PROTECTED] writes:
  I have the following structure:
   MyProgram/A.hs
   MyProgram/Aux/B.hs
   MyProgram/Aux/C.hs

 You have already received replies to your question, so let me make a
 different point.  If you ever intend your program to work on Windows,
 do not use Aux as a file or directory name!  The libraries mailing
 list has some recent experience of this.  (Apparently Aux is a
 reserved filename on Windows and you get strange behaviour if you
 try to use it for anything else.)

Thanks for the tip, I'm working in linux though and Aux was really just an 
example :)

J.A.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Namespace trouble

2004-05-19 Thread Jorge Adriano Aires
Hello,
I have the following structure:

 MyProgram/A.hs
 MyProgram/Aux/B.hs
 MyProgram/Aux/C.hs

and:
 A imports C
 B imports C

Can I make this work using namespaces only (i.e. no -i flag)? 
I expected this to work:

 MyProgram/A.hsname: Aimport Aux.C
 MyProgram/Aux/B.hsname: Aux.Bimport C
 MyProgram/Aux/C.hsname: Aux.C

But complains when importing C from B since its name is Aux.C.
What is the most elegant way to deal with such cases?

J.A.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Namespace trouble

2004-05-19 Thread David Brown
On Wed, May 19, 2004 at 08:13:11PM +0100, Jorge Adriano Aires wrote:

  MyProgram/A.hsname: Aimport Aux.C
  MyProgram/Aux/B.hsname: Aux.Bimport C
  MyProgram/Aux/C.hsname: Aux.C
 
 But complains when importing C from B since its name is Aux.C.
 What is the most elegant way to deal with such cases?

The heirarchical module names are always full paths to the module.
Aux.B still needs to refer to Aux.C.

This is annoying if you want to move something into a different place,
since it will refer to itself entirely using the full names.

The description of the Heirarchical module standard suggests that they
are open to ideas for improvement :-)

Dave Brown
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Namespace trouble

2004-05-19 Thread Jorge Adriano Aires
 I expected this to work:
  MyProgram/A.hsname: Aimport Aux.C
  MyProgram/Aux/B.hsname: Aux.Bimport C
  MyProgram/Aux/C.hsname: Aux.C

 But complains when importing C from B since its name is Aux.C.
 What is the most elegant way to deal with such cases?


Answering myself, this works:
 MyProgram/A.hsname: Aimport Aux.C
 MyProgram/Aux/B.hsname: Aux.Bimport Aux.C
 MyProgram/Aux/C.hsname: Aux.C

I just have to load B from MyProgram when testing it in ghci, instead of 
loading it in MyProgram/Aux. Thanks to Lunar for the tip.

J.A.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users