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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.167.9 with SMTP id e9mr4498707ywh.3.1477038432492; Fri, 21 Oct 2016 01:27:12 -0700 (PDT) X-Received: by 10.157.32.11 with SMTP id n11mr2327666ota.4.1477038432453; Fri, 21 Oct 2016 01:27:12 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!f6no1028417qtd.0!news-out.google.com!w143ni262itb.0!nntp.google.com!e187no1278531itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 21 Oct 2016 01:27:12 -0700 (PDT) In-Reply-To: <174e458e-70b8-411b-b1aa-b888838145d1@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.167.111.208; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 85.167.111.208 References: <9f771768-9d3e-43a1-b2e7-048851f5b4f9@googlegroups.com> <174e458e-70b8-411b-b1aa-b888838145d1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <14d731a6-a231-482c-8f6d-b907933520c0@googlegroups.com> Subject: Re: Where to find good/simple examples for gnatcoll (python)? From: reinkor Injection-Date: Fri, 21 Oct 2016 08:27:12 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:32149 Date: 2016-10-21T01:27:12-07:00 List-Id: Thanks so far. My up to date debian jessie seems not yet to include these new features. However, I tried the program below. It builds, but I get "raised CONSTRAINT_ERROR : t1.adb:10 access check failed" (something goes wring at the line "Data : Callback_Data'Class := Create (Python, 2);") Any help in my attempt to learn fast is appreciated. with Ada.Text_IO; use Ada.Text_IO; with GNATCOLL.Scripts; use GNATCOLL.Scripts; with GNATCOLL.Scripts.Python; use GNATCOLL.Scripts.Python; with GNATCOLL.Scripts.Shell; use GNATCOLL.Scripts.Shell; procedure T1 is Repo : Scripts_Repository := new Scripts_Repository_Record; Python : Scripting_Language := Lookup_Scripting_Language (Repo, "python"); Data : Callback_Data'Class := Create (Python, 2); Result : Integer; begin Data.Set_Nth_Arg (1, 2); Data.Set_Nth_Arg (2, 3); Data.Execute_Command ("./test1.py"); -- newer versions of gnatcoll Result := Data.Return_Value; end T1; Here is the project file for it: with "gnatcoll_python"; with "gnatcoll_gmp"; project T1 is for Source_Dirs use ("src"); for Object_Dir use "obj"; for Exec_Dir use "."; for Main use ("t1.adb"); end T1; reinert