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.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, PP_MIME_FAKE_ASCII_TEXT,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,ff949d1e0d505dfc,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-13 02:16:40 PST From: "Frank" Newsgroups: comp.lang.ada Subject: Using Grace.Lists.Unbounded in WindowsXP/GNAT3.15p X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Original-NNTP-Posting-Host: 213.225.111.73 Message-ID: <3e705a78$1@news.wineasy.se> X-Original-Trace: 13 Mar 2003 11:16:24 +0100, 213.225.111.73 X-Complaints-To: abuse@songnetworks.se NNTP-Posting-Host: news.wineasy.se X-Original-NNTP-Posting-Host: news.wineasy.se Date: 13 Mar 2003 11:16:25 +0100 X-Trace: wineasy!newsfeed.wineasy.se!news.sto.telegate.se 1047550585 news.wineasy.se (13 Mar 2003 11:16:25 +0100) X-Complaints-To: abuse@songnetworks.se Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.algonet.se!algonet!news.stupi.se!news.stupi.se!wineasy!newsfeed.wineasy.se!news.sto.telegate.se!news.wineasy.se!not-for-mail Xref: archiver1.google.com comp.lang.ada:35285 Date: 2003-03-13T11:16:25+01:00 List-Id: Hi! Using WindowsXP/GNAT3.15p/Grace.Lists "1.1". See source code and execution-dump at the end. 1) In this example I add a number of nodes to a list, and traverse them successfully to print their contence. 2) I traverse the list until the second node. Then I try to remove the second Node. The library now throws me a CONSTRAINT_ERROR. Where am I mistaking? ---- The big picture(but not fully coded in this example): What I want to achieve is to be able to traverse a list, and based on information in the node, decide to remove it from the current position in the list and reinsert it at the end. This is done to postpone the calculation of the Node until all other Nodes have been calculated. Frank J�rgensen ------------------------------------------------ with Grace.Lists.Unbounded; with Test_List_Pkg; with Ada.Text_IO; procedure Test_List is Allowed_Nodes : Test_List_Pkg.Test_Nodes.List := Test_List_Pkg.Test_Nodes.Empty; Tmp_Trav : Test_List_Pkg.Test_Nodes.Iterator; Tmp_Data : Integer; begin Test_List_Pkg.Test_Nodes.Insert (Allowed_Nodes, 1, Test_List_Pkg.Test_Nodes.Tail); Test_List_Pkg.Test_Nodes.Insert (Allowed_Nodes, 2, Test_List_Pkg.Test_Nodes.Tail); Test_List_Pkg.Test_Nodes.Insert (Allowed_Nodes, 3, Test_List_Pkg.Test_Nodes.Tail); Test_List_Pkg.Test_Nodes.Insert (Allowed_Nodes, 4, Test_List_Pkg.Test_Nodes.Tail); Tmp_Trav := Test_List_Pkg.Test_Nodes.Head(Allowed_Nodes); while Test_List_Pkg.Test_Nodes.Has_Item(Tmp_Trav) loop Tmp_Data := Test_List_Pkg.Test_Nodes.Item(Tmp_Trav); Ada.Text_IO.Put_Line("---" & Tmp_Data'Img); Tmp_Trav := Test_List_Pkg.Test_Nodes.Next(Tmp_Trav, Test_List_Pkg.Test_Nodes.Tail); end loop; Tmp_Trav := Test_List_Pkg.Test_Nodes.Head(Allowed_Nodes); Tmp_Trav := Test_List_Pkg.Test_Nodes.Next(Tmp_Trav, Test_List_Pkg.Test_Nodes.Tail); Test_List_Pkg.Test_Nodes.Remove (Tmp_Trav, Test_List_Pkg.Test_Nodes.Tail); end Test_List; ------------------------------------------------ with Grace.Lists.Unbounded; package Test_List_Pkg is package Test_Nodes is new Grace.Lists.Unbounded (Integer); end Test_List_Pkg; ------------------------------------------------ --- 1 --- 2 --- 3 --- 4 ERROR: After finalization of Empty object, 6 items have been allocated and 5 items have been freed. raised CONSTRAINT_ERROR : grace-lists-unbounded.adb:70 access check failed