comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: Code Search :-)
Date: 05 Jun 2003 16:57:42 -0400
Date: 2003-06-05T20:57:38+00:00	[thread overview]
Message-ID: <uadcwfdix.fsf@nasa.gov> (raw)
In-Reply-To: e723f896.0306051100.72c67f47@posting.google.com

DreySf@gmx.net (Drey) writes:

> Hi !
> 
> I have a small problem... 
> or i think i�m too lazy or i ask my self why i schould code something,
> that already has been coded :-)
> 
> I search for a package that is able make methods on a type alike an
> array.
> What i want from this type "Field" that ist works like an array (the
> dimensions of course are variable) but with one feature: I want to be
> able to change the borders of dimensions (Increase,Decrease).
> I hope i say it understandably. :-)

No, but your example is clearer. Just shows that Ada is the true
universal language :).

> Example:
> I have a Field that is limited 
> Var : Fieldtype( 1..3 , 1..6 , 1..8 ) of Elementtype
> 
> and after the Icrease(Dimension => 1, Border => 1) operation on the
> "Var" look like this: (It have the same Values of elementtype as
> before)
> Var : Fieldtype( _1..4_ , 1..6 , 1..8 ) of Elementtype

I have a package that does this for one dimensional arrays (other Ada
libraries have a similar package). See
http://www.toadmail.com/~ada_wizard/ada/sal.html, in particular the
SAL.Poly.Unbounded_Arrays package.

(argh. I just realized all of the links to the formatted source code
on that page are broken. I may get to fix them soon. You can download
the .tar.gz).

(one of my current projects is a web spider that checks that kind of
thing. Yes, I started with Tom Moran's 'finder').

I don't explicitly provide the "Increase" function, but the "Append"
function is similar.

> I tried to make it with Lists (access types), and i will further try
> to improve my code, but i hope that there is anybody who can help me
> :-)

I think there will be problems adapting my one-dimension package to
multiple dimensions. You may have to use a one-dimensional array
underneath, and do the multi-dimension index calculation yourself.

-- 
-- Stephe



      parent reply	other threads:[~2003-06-05 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-05 19:00 Code Search :-) Drey
2003-06-05 20:30 ` Preben Randhol
2003-06-05 20:57 ` Stephen Leake [this message]
replies disabled

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