comp.lang.ada
 help / color / mirror / Atom feed
* Re: student needs help for his project
  1999-01-11  0:00 student needs help for his project Bug
@ 1999-01-11  0:00 ` David C. Hoos
  0 siblings, 0 replies; 2+ messages in thread
From: David C. Hoos @ 1999-01-11  0:00 UTC (permalink / raw)



Bug wrote in message <369A311A.156DA9A1@ensica.fr>...
<snip>
>a list is a
>chained list if the name is the same in french and in english)
>
Well .. in English we usually say "linked list," but everyone should
understand you.

<snip>

>SO what i wanted to know is wether i need simply to think agin my
>construction or if a solution exists.


You cannot have a circular package dependency in Ada -- although C doesn't
care about such things.
You could simply declare cell in the list package.  Then you would do a
partial declaration of type cell, and defer its fill declaration, just as
you did for the type ring.

David C. Hoos, Sr.








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

* student needs help for his project
@ 1999-01-11  0:00 Bug
  1999-01-11  0:00 ` David C. Hoos
  0 siblings, 1 reply; 2+ messages in thread
From: Bug @ 1999-01-11  0:00 UTC (permalink / raw)


Hi i'd like to ask you a question.

I need to create a proggy like excel (very simplified of course)

I've got an array of cells and each cells contain infos such as -string
or expression to be evaluated

-cords of the cell in the array

-a pointer to a list of child cells (that depends on the content of the
parent one)

Ok are you following me? yep i think (sorry for the bad english but i'm
french... :)   )

I've got some packages to do this but two of them are giving me white
hair
                -the one that define the object "cell"
                -the one that define the object "list" (a list is a
chained list if the name is the same in french and in english)

Ok then, the list contains the pointers towards the child cells so in
the package list.ads, i need to refer to the package cells.ads, but as i

need list object i the definition of a cell i need to refer to the
package list.ads...it's like the snake that bit his tail...

Of course the compiler reject the thing..

SO what i wanted to know is wether i need simply to think agin my
construction or if a solution exists.

Here is part of the code :

*********************************************
with list,...;
use list,.....;

package cells is

..........

type cell is record
        content : ptr_content;           -- ptr content is a record of
two access types defined somewhere not important
        pos       : cords;                    -- line and row
        child_list : chained_list;               -- defined in the
list.ads
end record;

type ptr_cell is access cell;
..........

end cells;

*****************************************
with cells;
use cells;
package list is

....................
type ring;
type ptr_ring is access ring;
type ring is record
       information : ptr_cell;
       link : ptr_ring;
end record;
type chained_list is record
        lenght:natural;
        firts_case:ptr_ring;
end record;

.............

end list;








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

end of thread, other threads:[~1999-01-11  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-11  0:00 student needs help for his project Bug
1999-01-11  0:00 ` David C. Hoos

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