Basic Questions

This is a discussion on Basic Questions within the modula forums in Programming Languages category; Saluton! On Sun, 6 Apr 2008 22:06:23 -0700 (PDT), "O. Olson" wrote: > I have in the DEF File > FROM FIO IMPORT Create, Open, File, Close, WrStr, WrLn, WrLngCard, > WrCard; > And in the MOD file simply > IMPORT IO; > There is no where in the MOD File where it explicitly says IMPORT File > - like it does in the DEF. > This may explain why I might be getting an error in functions that > use" File" . While all the functions that give the error of not > matching the previous declaration have "File" ...

Go Back   Application Development Forum > Programming Languages > modula

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 04-07-2008, 03:01 AM
Jürgen Lerch
Guest
 
Default Re: Basic Questions

Saluton!

On Sun, 6 Apr 2008 22:06:23 -0700 (PDT), "O. Olson" wrote:
> I have in the DEF File
> FROM FIO IMPORT Create, Open, File, Close, WrStr, WrLn, WrLngCard,
> WrCard;
> And in the MOD file simply
> IMPORT IO;
> There is no where in the MOD File where it explicitly says IMPORT File
> - like it does in the DEF.
> This may explain why I might be getting an error in functions that
> use" File" . While all the functions that give the error of not
> matching the previous declaration have "File" as one of the parameters
> - there are a few functions that use "File" - but yet do not give the
> error.


Hm, if the .mod has ,,IMPORT IO'', shouldn't the usage be
,,IO.File'' instead of merely ,,File''?

Ad Astra!
JuL

--
jynwyn@gmx.de / Work like you don't need the money
Jürgen ,,JuL'' Lerch / Dance like no one was watching
/ Love like you've never been hurt
/ - ?

Reply With Quote
  #12  
Old 04-07-2008, 04:32 AM
JP2R
Guest
 
Default Re: Basic Questions

> I have in the DEF File
>
> FROM FIO IMPORT Create, Open, File, Close, WrStr, WrLn, WrLngCard,
> * * * * * * * * WrCard;
>
> And in the MOD file simply
>
> IMPORT IO;
>
> There is no where in the MOD File where it explicitly says IMPORT File
> - like it does in the DEF.



I think you got it ....
With XDS and ISO compilers you need the very same 'File' IMPORT clause
in the MOD
And yes Martin message points something very important.
JPRR
Reply With Quote
  #13  
Old 04-07-2008, 06:37 AM
Marco van de Voort
Guest
 
Default Re: Basic Questions

On 2008-04-07, JP2R <jp.dezaire@orange.fr> wrote:
>> I have in the DEF File
>>
>> FROM FIO IMPORT Create, Open, File, Close, WrStr, WrLn, WrLngCard,
>> * * * * * * * * WrCard;
>>
>> And in the MOD file simply
>>
>> IMPORT IO;
>>
>> There is no where in the MOD File where it explicitly says IMPORT File
>> - like it does in the DEF.

>
>
> I think you got it ....
> With XDS and ISO compilers you need the very same 'File' IMPORT clause
> in the MOD
> And yes Martin message points something very important.


No. Import xx; imports qualified only?

It would have to read

FROM IO IMPORT File;

to cause problems.
Reply With Quote
  #14  
Old 04-07-2008, 07:13 AM
JP2R
Guest
 
Default Re: Basic Questions

On Apr 7, 12:37 pm, Marco van de Voort <mar...@stack.nl> wrote:
> On 2008-04-07, JP2R <jp.deza...@orange.fr> wrote:
>
>
>
> >> I have in the DEF File

>
> >> FROM FIO IMPORT Create, Open, File, Close, WrStr, WrLn, WrLngCard,
> >> WrCard;

>
> >> And in the MOD file simply

>
> >> IMPORT IO;

>
> >> There is no where in the MOD File where it explicitly says IMPORT File
> >> - like it does in the DEF.

>
> > I think you got it ....
> > With XDS and ISO compilers you need the very same 'File' IMPORT clause
> > in the MOD
> > And yes Martin message points something very important.

>
> No. Import xx; imports qualified only?
>
> It would have to read
>
> FROM IO IMPORT File;
>
> to cause problems.


IMPORT xx imports QUALIFIED idents only
FROM xx IMPORT yy imports yy UNQUALIFIED
AND imports made in DEF is NOT known in MOD and you get an error with
XDS compiler
BUT with Topspeed this will compile ...

DEFINITION MODULE x;
FROM FIO IMPORT WrLn, File;
PROCEDURE Y (f: File);
END x.

------------------
IMPLEMENTATION MODULE x

PROCEDURE Y (f: File);
BEGIN
WrLn(f)
END Y;
END x.

Reply With Quote
  #15  
Old 04-07-2008, 03:17 PM
Marco van de Voort
Guest
 
Default Re: Basic Questions

On 2008-04-07, JP2R <jp.dezaire@orange.fr> wrote:
>> No. Import xx; imports qualified only?
>>
>> It would have to read
>>
>> FROM IO IMPORT File;
>>
>> to cause problems.

>
> IMPORT xx imports QUALIFIED idents only
> FROM xx IMPORT yy imports yy UNQUALIFIED
> AND imports made in DEF is NOT known in MOD and you get an error with
> XDS compiler


Huh? Is that conforming to the standard?
Reply With Quote
  #16  
Old 04-07-2008, 03:55 PM
JP2R
Guest
 
Default Re: Basic Questions

On Apr 7, 9:17 pm, Marco van de Voort <mar...@stack.nl> wrote:
> On 2008-04-07, JP2R <jp.deza...@orange.fr> wrote:
>
> >> No. Import xx; imports qualified only?

>
> >> It would have to read

>
> >> FROM IO IMPORT File;

>
> >> to cause problems.

>
> > IMPORT xx imports QUALIFIED idents only
> > FROM xx IMPORT yy imports yy UNQUALIFIED
> > AND imports made in DEF is NOT known in MOD and you get an error with
> > XDS compiler

>
> Huh? Is that conforming to the standard?


Well I never read directly ISO standards texts (far too expensive),
but from documents I could read I think that it's Topspeed that is NOT
standard (and far from) - anyway at this time there was not yet a
standard, apart the de facto topspeed one in the PC/MSDOS world.
XDS has a good documentation of ISO language on his site - and as I
understand it each ident must be introduced in the module scope either
by a definition, a declaration or an IMPORT ... and a DEF module is
distinct of the matching implementation.
Reply With Quote
  #17  
Old 04-08-2008, 07:14 PM
O. Olson
Guest
 
Default Re: Basic Questions

Thanks to all of you for posting.

I think I managed to figure this out by copying the Import statement
from the DEF File to the MOD File. Now the error goes away - but my
file still has other errors to deal with - so I am not entirely sure
if this worked or not.

Thanks again.
O.O.


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:17 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.