From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Permutation generator in ada library Date: Fri, 03 Oct 2014 19:08:35 +0300 Organization: Tidorum Ltd Message-ID: References: <5b7788b4-323f-42db-99e9-66c989992abb@googlegroups.com> <1d9e9cd4-3087-4357-9353-db4424a16e9b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net 6Yt+xuF5jcYf7D7K6PJUywMjrc/ryvGz99CYW5A3O0wHwJEnB2 Cancel-Lock: sha1:/gbQzxBi61QZcD+VD442WiUKdIE= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:22041 Date: 2014-10-03T19:08:35+03:00 List-Id: 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 . @ .