On Mon, 11 Feb 2008, Bill Page wrote: | On 2/11/08, Gabriel Dos Reis wrote: | > On Mon, 11 Feb 2008, Bill Page wrote: | > | | > | As I said before, allowing arbitrary strings of symbols to be a member | > | of Symbol could be very similar to how subscripts are represented. | > | | > | (5) -> script(alpha,[[i,j],[k,l,m],[a],[b,c]])::OUTFORM::SEX | > | | > | (5) (*02312alpha i j k l m a b c) | > | Type: SExpression | > | > | > Am I the only one to be bothered by this purely syntactic encoding | > of something that could have semantics content? | > | | If you are referring to the name-mangling to encode subscript | information, then no, you are not the only one. Actually, I think it | is rather shocking to see such a hack here! Surely there is a better | way. It would be interesting to see what breaks if one attempted to | replace the internal representation of the Symbol domain with | something more "axiomatic".
I came to this about a year ago, when I was trying to write some algebras based on `Symmetries and Differential Equations' by Bluman&Kumei. I wanted to abstract over the scripts, only to discover that the parser has its own idea about scripts. | > I've always been annoyed that the parser would decide to encore | > subscript, before semantics processing starts. | > | | It is not clear to me what part the parser plays in this, nor how this | might differ between the Axiom interpreter and Spad. Perhaps you can | explain? See src/interp/postpar.boot postScriptsForm(["Scripts",op,a],argl) == [getScriptName(op,a,#argl),:postTranScripts a,:argl] postScripts ["Scripts",op,a] == [getScriptName(op,a,0),:postTranScripts a] getScriptName(op,a,numberOfFunctionalArgs) == if null IDENTP op then postError ['" ",op,'" cannot have scripts"] INTERNL("*",STRINGIMAGE numberOfFunctionalArgs, decodeScripts a,PNAME op) `postparsing' is done long before the compiler does anything. And this is not the only place where unfortunate semantics decisions are made by parser long before we get to semantics processing. | But it seems obvious that the interface to the Symbol domain is | intended to serve rather general purposes. Consider for example the | definition: | | elt(sy,lx) == subscript(sy,lx) | | which seems to imply that writing | | A[i,j] | | should result in a call to subscript$Symbol. Writing: | | (1) -> )set mes bot on | (1) -> A[i,j] | | in the interpreter confirms this. So I think one might claim that the | decision to treat 'A[i,j]' as a subscripted symbol is in fact a | semantic one. No? No, you're seeing only half of the picture :-) See above. -- Gaby ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel