comp.lang.ada
 help / color / mirror / Atom feed
* Sledgehammer Indexing Tools
@ 2012-08-06 18:36 3-toed Sloth
  2012-08-06 21:28 ` Patrick
  2012-08-07 10:55 ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: 3-toed Sloth @ 2012-08-06 18:36 UTC (permalink / raw)


Hi everybody,

I've just released some document indexing tools for GNU/Linux on launchpad which are written in Ada:

https://launchpad.net/sledgehammer

They come with a makefile and a GPS project file. They heavily depend on external converters, so please check the dependencies in the Readme file before trying the indexer out.

Comments and suggestions for improvement are welcome. Please bear in mind that I'm a hobbyist and this is only the second Ada program I've ever written, though, so please don't be too harsh with your criticisms. :-)

Perhaps someone finds part if this useful.


Best,

Erich



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Sledgehammer Indexing Tools
  2012-08-06 18:36 Sledgehammer Indexing Tools 3-toed Sloth
@ 2012-08-06 21:28 ` Patrick
  2012-08-07 10:55 ` Simon Wright
  1 sibling, 0 replies; 8+ messages in thread
From: Patrick @ 2012-08-06 21:28 UTC (permalink / raw)


Hi Erich

Thanks for sharing.

It built fine on Xubunu and I am reading through it now



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Sledgehammer Indexing Tools
  2012-08-06 18:36 Sledgehammer Indexing Tools 3-toed Sloth
  2012-08-06 21:28 ` Patrick
@ 2012-08-07 10:55 ` Simon Wright
  2012-08-07 11:41   ` john
  1 sibling, 1 reply; 8+ messages in thread
From: Simon Wright @ 2012-08-07 10:55 UTC (permalink / raw)


3-toed Sloth <john@peppermind.com> writes:

> I've just released some document indexing tools for GNU/Linux on
> launchpad which are written in Ada:
>
> https://launchpad.net/sledgehammer
>
> They come with a makefile and a GPS project file. They heavily depend
> on external converters, so please check the dependencies in the Readme
> file before trying the indexer out.
>
> Comments and suggestions for improvement are welcome. Please bear in
> mind that I'm a hobbyist and this is only the second Ada program I've
> ever written, though, so please don't be too harsh with your
> criticisms. :-)

Erich,

Thanks for sharing.

Since I'm on Mac OS X I'd probably have trouble meeting the
preconditions! However, a comment or two --

Your repo contains .npp and .adt files, both of these are generated and
shouldn't be there.

In - for example - external_lookup.ads, you've "use"d several of your
own packages. I'd think that you can reasonably expect readers to know
the standard library (for example, Indefinite_Vectors), but how can they
know where Occurrences is defined?

Again in external_lookup.ads, couldn't most of the private part be moved
to the package body?

Have you looked at GNAT.OS_Lib, which contains various Spawn
subprograms?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Sledgehammer Indexing Tools
  2012-08-07 10:55 ` Simon Wright
@ 2012-08-07 11:41   ` john
  2012-08-07 11:55     ` Marius Amado-Alves
  0 siblings, 1 reply; 8+ messages in thread
From: john @ 2012-08-07 11:41 UTC (permalink / raw)


Hi Simon,

> Your repo contains .npp and .adt files, both of these are generated and
> 
> shouldn't be there.

Yep, I agree. It seems that gnatclean does not remove them. I also need to edit the exclude lists for bazaar.

> 
> 
> In - for example - external_lookup.ads, you've "use"d several of your
> 
> own packages. I'd think that you can reasonably expect readers to know
> 
> the standard library (for example, Indefinite_Vectors), but how can they
> 
> know where Occurrences is defined?

That I don't understand.They are defined in the respective source packages. Do you mean I should comment the use of these packages better in the source code?

> Again in external_lookup.ads, couldn't most of the private part be moved
> 
> to the package body?

Good question. I vaguely remember that I instantiated generic packages and assigned values to variables in the private part on purpose, but I can't remember exactly why. I'll check that.

By the way, to make this more portable I probably shouldn't hardcode the paths to the helper utilities either. Is there a "standard" way to find executable paths on Linux and other Unix-like systems?

Anyway, thanks a lot for the feedback! 


Best,

Erich




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Sledgehammer Indexing Tools
  2012-08-07 11:41   ` john
@ 2012-08-07 11:55     ` Marius Amado-Alves
  2012-08-07 17:16       ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Marius Amado-Alves @ 2012-08-07 11:55 UTC (permalink / raw)


> > In - for example - external_lookup.ads, you've "use"d several of your
> > own packages. I'd think that you can reasonably expect readers to know
> > the standard library (for example, Indefinite_Vectors), but how can they
> > know where Occurrences is defined?

> That I don't understand.They are defined in the respective source packages.

In WHICH one? That's the problem. Don't use "use". Use full qualification

   ... The_Package_Where.Occurrences_Is_Defined.Occurrences ...

or renaming

   package TPWOID renames The_Package_Where.Occurrences_Is_Defined;
   ...
   ... TPWOIS.Occurrences

or a single "use" in a block

   declare
      use The_Package_Where.Occurrences_Is_Defined;
   begin
      ... Occurences ...

or only "use type" (also in a block) if you only need some operators.
(I have not looked at the specific code.)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Sledgehammer Indexing Tools
  2012-08-07 11:55     ` Marius Amado-Alves
@ 2012-08-07 17:16       ` Simon Wright
  2012-08-07 20:24         ` Marius Amado-Alves
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2012-08-07 17:16 UTC (permalink / raw)


Marius Amado-Alves <amado.alves@gmail.com> writes:

>> > In - for example - external_lookup.ads, you've "use"d several of your
>> > own packages. I'd think that you can reasonably expect readers to know
>> > the standard library (for example, Indefinite_Vectors), but how can they
>> > know where Occurrences is defined?
>
>> That I don't understand.They are defined in the respective source packages.
>
> In WHICH one? That's the problem. Don't use "use". Use full
> qualification
>
>    ... The_Package_Where.Occurrences_Is_Defined.Occurrences ...
>
> or renaming
>
>    package TPWOID renames The_Package_Where.Occurrences_Is_Defined;
>    ...
>    ... TPWOIS.Occurrences
>
> or a single "use" in a block
>
>    declare
>       use The_Package_Where.Occurrences_Is_Defined;
>    begin
>       ... Occurences ...
>
> or only "use type" (also in a block) if you only need some operators.
> (I have not looked at the specific code.)

In this case, external_lookup.ads might say

   package Occurrences_Vector is new Indefinite_Vectors (
      Natural,
      Token_Maps.Occurrences.Map,
      Token_Maps.Occurrences."=");



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Sledgehammer Indexing Tools
  2012-08-07 17:16       ` Simon Wright
@ 2012-08-07 20:24         ` Marius Amado-Alves
  2012-08-07 21:14           ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Marius Amado-Alves @ 2012-08-07 20:24 UTC (permalink / raw)


> > ... Use full qualification (marius)

> In this case, external_lookup.ads might say
> 
>    package Occurrences_Vector is new Indefinite_Vectors (
>       Natural,
>       Token_Maps.Occurrences.Map,
>       Token_Maps.Occurrences."=");
> (simon)

Yes. (GPS told you that, right ?:-)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Sledgehammer Indexing Tools
  2012-08-07 20:24         ` Marius Amado-Alves
@ 2012-08-07 21:14           ` Simon Wright
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Wright @ 2012-08-07 21:14 UTC (permalink / raw)


Marius Amado-Alves <amado.alves@gmail.com> writes:

>> > ... Use full qualification (marius)
>
>> In this case, external_lookup.ads might say
>> 
>>    package Occurrences_Vector is new Indefinite_Vectors (
>>       Natural,
>>       Token_Maps.Occurrences.Map,
>>       Token_Maps.Occurrences."=");
>> (simon)
>
> Yes. (GPS told you that, right ?:-)

grep, actually.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-08-13  9:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06 18:36 Sledgehammer Indexing Tools 3-toed Sloth
2012-08-06 21:28 ` Patrick
2012-08-07 10:55 ` Simon Wright
2012-08-07 11:41   ` john
2012-08-07 11:55     ` Marius Amado-Alves
2012-08-07 17:16       ` Simon Wright
2012-08-07 20:24         ` Marius Amado-Alves
2012-08-07 21:14           ` Simon Wright

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