comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Permutation generator in ada library
Date: Fri, 03 Oct 2014 19:08:35 +0300
Date: 2014-10-03T19:08:35+03:00	[thread overview]
Message-ID: <c97vvvF3dpmU1@mid.individual.net> (raw)
In-Reply-To: <mlvXv.131770$GC3.127521@fx20.fr7>

On 14-10-03 14:00 , Brian Drummond wrote:
> On Thu, 02 Oct 2014 21:01:57 -0700, Stribor40 wrote:
> 
>> in the post above there is package that generates these permutations....
>>
>> I have saved 3 files....in same order as the files are in posting
>> Generic_Perm.ads  Generic_Perm.adb   Print_Perms.adb
>>
>> when i try to compile....gnatmake Print_Perms.adb I get error...
>>
>> Generic_Perm.adb:1:14: file "generic_perm.ads" not found gnatmake:
>> "Generic_Perm.adb" compilation error
>>
>> What am i doing wrong?
> 
> Gnat for some reason lower-cases the filenames when generating them from 
> the package names.

The reason is IMO clear: package names are case-insensitive in Ada, so
the context clauses "with PKG" and "with Pkg" refer to the same package.
If you want to generate case-sensitive file names from package names,
the case distinction must be suppressed, so the reasonable choices are
all-upper-case or all-lower-case, with the lower-case alternative
clearly preferable as few people keep their Caps-Lock on.

> On Linux, the filenames Generic_Perm.ads and generic_perm.ads actually 
> refer to different files

Yes, but the weird thing is that the error message Stribor40 quotes
shows that GNAT is compiling the generic package body in
Generic_Perm.adb, but cannot find the declaration in generic_perm.ads.
Oh well, I understood it is working with lower-case names, so...

(OMG, fiddling with this question made me realise that Mac OS-X uses, by
default, case-insensitive file names, although it is otherwise
Unix-type. Funny things happen, for example the command "mv -i aaa AAA"
asks me if I want to "overwrite AAA? (y/n [n])" - but there is no AAA...)

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .


  reply	other threads:[~2014-10-03 16:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03  0:36 Permutation generator in ada library Stribor40
2014-10-03  4:01 ` Stribor40
2014-10-03  4:34   ` AdaMagica
2014-10-03  4:47     ` Stribor40
2014-10-03 19:32       ` Shark8
2014-10-03 20:47         ` Simon Wright
2014-10-04  3:01           ` Shark8
2014-10-04  7:05             ` Simon Wright
2014-10-09 22:29           ` Randy Brukardt
2014-10-03  4:51     ` Stribor40
2014-10-03  6:28       ` Niklas Holsti
2014-10-03 10:10         ` Stribor40
2014-10-03 11:13           ` Simon Wright
2014-10-03  4:36   ` Niklas Holsti
2014-10-03  4:42     ` Stribor40
2014-10-03 11:00   ` Brian Drummond
2014-10-03 16:08     ` Niklas Holsti [this message]
2014-10-03 16:57       ` Björn Lundin
2014-10-03 12:54 ` john
2014-10-03 18:50 ` jpwoodruff
2014-10-04 18:06   ` Dirk Craeynest
2014-10-09 22:37     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox