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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,80a657b612f5bad1 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news.motzarella.org!motzarella.org!not-for-mail From: Ivan Levashew Newsgroups: comp.lang.ada Subject: Re: Creating and using Ada packages: need refinement Date: Sun, 30 Mar 2008 18:11:42 +0700 Organization: A noiseless patient Spider Message-ID: References: <1205541163.8209.16.camel@K72> <87fxur8un0.fsf@ludovic-brenta.org> <2906e78e-effb-4c99-a331-effdaeb987c5@e10g2000prf.googlegroups.com> <87bq51b53o.fsf@ludovic-brenta.org> <70f327d6-5a7a-4118-8871-ad35e7528c2d@e23g2000prf.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: feeder.motzarella.org U2FsdGVkX19eVaxonKQv0GAHV6vLLDyf4EAF6JhCZsGliLLZYz8U3QsLKdnI/USPEg3ccMCWTge1HtF6TQgnlg8OZzQ0C/wbSbnKgc8TiOyiE+tj5lxhGuTf+KGblvrq1cB9nFoup8Lb24qRFrSd/w== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Sun, 30 Mar 2008 11:11:33 +0000 (UTC) In-Reply-To: <70f327d6-5a7a-4118-8871-ad35e7528c2d@e23g2000prf.googlegroups.com> X-Auth-Sender: U2FsdGVkX1+acqhCXj6857QG/GZCWdURG+DLktGFif84Xe/uDRw+6g== X-Image-URL: http://img220.echo.cx/img220/9664/111408397042725603791c71pb.gif Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUAAAOZlpMaJz3/9fYs //8FP1E2M3Qbef+MAAACEklEQVQ4jZ2TTW7bMBCFJwO465B2uqZfS+4NnyBA7LXMerSPEPL+R+gb KqmTIAWKDiCCmo9v/kSJqGaVJCp/TLk3kbypSPmdX2QD2YikTUrAe6CqiWuCL/LR3Cfu/AJgbP4K Phtjfz77vwAfOv4XkNPXVSkqwZvmfTZMAriHMOGG1EOt7xw1Rli8hTIkV4DDTIFn6qqYZJ5JFLhT yIVnHAoIrlYTNGKf7yVMUS4yvYITdC8EMaZwHyX4t4ERnCv2uN+HGMFH4x2bHuDEahD1IUR18LAn mC3Jjork3Wny28Gp+h1pMhR08VV9s55hc/J08qrg90RHP15uXag4c1pYMFvVbHmBB3bFtVGBpVwe z+Hno7UyABU8yYEt1l5q+P54Mj8sM5dsVdRqu4RDCLvWGn2lj8pMJdC2BMdtCFG0L8rptiz6Y3s8 Hh1wjehXby133vRneo5hBSgvu+rfozdodnDYui6g7645m1jpVXELFUtnz6yo9MUKfo1YhzXF6WSc bu09Ax7rcGSsgNKezKggaDNGLH8icz80EsmlcwxOPMcBBJZd0VnWzOnSGbYUMEXNnqO00gvB4p1T gG7TUMydxjljz9xxAAyFzUvpfiEZLHD91iwNhVmvfXybYaksDioVlDh4JdqbwVYFyQ2Unq8EeQDr GDfcrS/ZUF8VJAtWUW8pPyFXr8oDMun4r0pHgiVMafoNgUqRDtakwdAAAAAASUVORK5CYII= X-Face: *tpB#/X3&Zh\?<4l;hAgY:m6lt6L]v#Udy\Xwy{@<'qP=9clA}kEbbSV1]B0a^O{|ibsNV~|zu.Da}V4*se@ns!8*Bt$9l-]nbD}o*7ml9J2)u:"!6P%_-`y9,'.L.Psp),njUf!=F5;kx%~\,'D$%{" Cancel-Lock: sha1:5OYO7kXKpiAfKuRDTHHPHiHyyEg= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; ru; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 ThunderBrowse/3.2.1 Mnenhy/0.7.5.666 Xref: g2news1.google.com comp.lang.ada:20642 Date: 2008-03-30T18:11:42+07:00 List-Id: > Not affiliated with Pegasoft or BUSH, but have always liked the idea > of an Ada based shell scripting language for Ada people. Yes, I had an idea of Ada-like scripting *SHELL* language. But I'm not satisfied with BUSH. I have reviewed BUSH documentation. http://www.pegasoft.ca/docs/bushtutorial.html#2.1 > => v := (2*3 + 5)/2 > => (Assuming v is a new universal_numeric variable) > => ? v > 5.50000000000000E+00 a surprise Being and Ada programmer I would expect it to be integer. Delphi has separate "/" and "div" operators for integer and floating point division. Ada has only one "/". I'm unhappy with the fact that "/" defaults to the floating point result here. http://www.adaic.com/standards/05rm/html/RM-3-3-2.html > The named number denotes a value of type universal_integer if the > type of the static_expression is an integer type. The named number > denotes a value of type universal_real if the type of the > static_expression is a real type. I'd like "v := (2*3 + 5)/2" in BUSH behave the same way as "v : constant := (2*3 + 5)/2" in Ada, but constantcy. How many times did you need to deal with float types in the shell script? I can't remember a one. So it's better to require explicit typecasts here. There must be separate universal float and integer. Integers are not just subset of Floats. http://www.pegasoft.ca/docs/bushtutorial.html#2.3 > The format of the SQL command, including how quoting is used, is > determined by the database being used. BUSH will not perform file > globbing (otherwise select count(*) would give very strange > results!). BUSH will substitute variables with dollar sign expansion > and the output from SQL commands can be redirected like an operating > system command. For this reason you'll have to escape characters > like ">" with a backslash used with SQL on the command line. > > => select * from test where name \> 'c' a pitfall What's the difference between C's if (a = 0) {... and BUSH's ... name > 'c' ? I'd better choose another syntax for redirection. Or maybe make parser a bit smarter? => select * from test where name > 'c' > filename I don't know SQL, but "> filename" looks like being unable to introduce ambiguities. OK, I know, it's not a good solution. What else can we do? Let's think... => select * from test where name > 'c' 1> filename It is much better, isn't it? Just require everybody to write whitespaces around ">", "<", etc. in SQL. Normal programmers write them anyway. > -- export DISPLAY only if it exists > DISPLAY : string := "undefined"; > pragma unchecked_import( shell, DISPLAY ); > if DISPLAY /= "undefined" then > pragma export( shell, DISPLAY ); > end if; a dirty trick http://www.pegasoft.ca/docs/bushref.html#3.7 All the types are lowercased. It is OK in an interactive prompt, but it's ugly IMO in full-sized scripts. I'd like to dupe every type in Mixed_Case. Or maybe let types be case-insensitive. A bit inconsistent but... It's not beautiful. I'm using bash for a long time. I had some wishes regarding shell capabilities : 1. Directories as a first-order objects. I'd like to write something like => zzz_src := tgz.extract (directory.open ("xxx/yyy/zzz.tgz")) => zzz_image := zzz_src.configure => zzz_image.make => zzz_destroot := zzz_image.install => directory.save (zzz_destroot, "~/zzz_destroot") And let the shell take care of cleaning intermediate results: zzz_image was not bound to anything. I'd like to use projects the same way. Projects are not neccessarily just one directory. I mean extension projects. 2. Downwards shell closures. Shell closure is a special program like this: #!/usr/bin/closure /var/shell-ipc/xxx 112312 Where /var/shell-ipc/xxx is a socket and 112312 is a shell closure identifier. Shell must create these temporary closures on demand. I have no clear model of relationships between "internal" and "external" objects. Internal objects are like zzz_image. They exist somewhere but are not bound to any location. After they lose the last reference, they are subject to deletion. I thought about 'Location attribute for internal objects. In order to allow external utilities to deal with internal objects we must either "save" it to some location or deal with it in situ, by its current location. Downwards shell closure can't be saved. (It will be a continuation this way). It is usable only during its lifetime so one must use 'Location. 'Location will create temporary executable closure stub: declare procedure CC_Wrapper (...) is begin ... end CC_Wrapper; begin zzz_image := zzz_src.configure (CC => CC_Wrapper'Location); zzz_image.make; end; 3. Make capabilities. bash calls make, make calls bash, bash calls make... One must remember the rules of escaping and quoting. Simple sequences without loops look the same way as they are in bash, but loops must be written with '; \'. $() works different ways in make and bash. build: for arch in $$ARCHS uni; do \ mkdir -p Intermediate/out/$$arch; \ mkdir -p Intermediate/out/$$arch/lib/pkgconfig; \ cp -r Input/darwin-pkgs/ Intermediate/out/$$arch/lib/pkgconfig/; \ ln -s "$$SDK"/* Intermediate/out/$$arch/; \ done for i in Frozen/* ; do \ ln -s ../"$$i" Intermediate/"$${i:7}" ; \ done Piece of my environment. I think make is better be extension of shell. Make is usable in many ways, not just for compilation. Once again: => zzz_src := tgz.extract (...) => zzz_image := zzz_src.configure => zzz_image.make => zzz_destroot := zzz_image.install It looks make-ish, isn't it? What was make initially created for? To avoid recompilations and recomputations. It's a kind of optimization. I think it could be implemented in the scope of shell scripting. I would like all the gprbuild capabilities to be incorporated into the shell. I need some time to formalize it. -- If you want to get to the top, you have to start at the bottom