From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22626 invoked by alias); 28 Jul 2007 16:48:35 -0000 Received: (qmail 22614 invoked by uid 22791); 28 Jul 2007 16:48:35 -0000 X-Spam-Check-By: sourceware.org Received: from jess.glam.ac.uk (HELO jess.glam.ac.uk) (193.63.147.97) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 28 Jul 2007 16:48:32 +0000 Received: from j228-gm.comp.glam.ac.uk ([193.63.148.84]) by jess.glam.ac.uk with esmtp (Exim 3.35 #1) id 1IEpSN-0002oQ-00; Sat, 28 Jul 2007 17:47:55 +0100 Received: from gaius by j228-gm.comp.glam.ac.uk with local (Exim 4.63) (envelope-from ) id 1IEpN9-0001jE-Id; Sat, 28 Jul 2007 17:42:31 +0100 From: Gaius Mulley To: Jim Blandy Cc: "Pierre Muller" , Subject: Re: [PATCH] Unbounded array support implemented (for Modula-2) References: <874pjs57zg.fsf@j228-gm.comp.glam.ac.uk> <002a01c7cf57$b881b0c0$29851240$@u-strasbg.fr> Date: Mon, 30 Jul 2007 06:29:00 -0000 In-Reply-To: (Jim Blandy's message of "Fri, 27 Jul 2007 14:44:26 -0700") Message-ID: <87abtgscnc.fsf@j228-gm.comp.glam.ac.uk> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00306.txt.bz2 Jim Blandy writes: > "Pierre Muller" writes: >> Modula-2 is not the only language supporting unbounded >> arrays, I would be interested in using the same kind of code for >> pascal language support. > > In C, there are ABI documents that specify how each type is > represented in memory for a given processor, the goal being to specify > things enough that one can link code from different vendor's compilers > together when they implement the same ABI. It sounds like the 'PIM' > documents are the equivalent for Modula-2; is that right? Hi Jim, ah alas, the PIM (Programming in Modula-2 books by N. Wirth) ed2, ed3 and ed4 don't say how unbounded arrays should be implemented or anything about parameter ordering etc - they really concentrate on the semantics of the language itself and to a lesser extent the libraries. The ISO standard doesn't say much about unbounded array implementation either - although it does tidy up many other loose ends. > Are there equivalent documents for Pascal? > > I'm not sure it actually would be a good idea to unify Pascal and > Modula-2 code if they are meant to follow different specifications. > Bugs in that common code might have the same fix for both languages, > or they might not. People would hesitate to fix things, for fear of > breaking the other language they're not familiar with. > > I don't think we should require Gaius's patch to unify the > Pascal/Modula-2 support. I agree :-) the amount of shared code would be fairly small anyhow and many blocks would have to be predicated by testing whether we were in Modula-2 language mode or Pascal language mode. At which point it begs the question whether these sections of code would be better separately placed into m2-valprint.c, p-valprint.c, m2-typeprint.c and p-typeprint.c etc. regards, Gaius