From 12c08d022465104b0a0366689700bab191857aac Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 17 May 2008 17:47:04 +0000 Subject: * interp/format.boot (form2String1): Handle PAREN. * interp/g-cndata.boot (condUnabbrev): Handle homogeneous varargs for constructors taking tuples. * interp/i-resolv.boot: Revolve domains and categories. --- src/interp/format.boot | 14 +++++++++----- src/interp/g-cndata.boot | 7 ++++++- src/interp/i-resolv.boot | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) (limited to 'src/interp') diff --git a/src/interp/format.boot b/src/interp/format.boot index d1e6e4df..9550ebd5 100644 --- a/src/interp/format.boot +++ b/src/interp/format.boot @@ -1,6 +1,6 @@ --- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007, Gabriel Dos Reis. +-- Copyright (C) 2007-2008, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -15,7 +15,7 @@ -- the documentation and/or other materials provided with the -- distribution. -- --- - Neither the name of The Numerical ALgorithms Group Ltd. nor the +-- - Neither the name of The Numerical Algorithms Group Ltd. nor the -- names of its contributors may be used to endorse or promote products -- derived from this software without specific prior written permission. -- @@ -424,6 +424,9 @@ form2String1 u == op = 'BRACKET => argl' := form2String1 first argl ["[",:(atom argl' => [argl']; argl'),"]"] + op = 'PAREN => + argl' := form2String1 first argl + ["(",:(atom argl' => [argl']; argl'),")"] op = "SIGNATURE" => [operation,sig] := argl concat(operation,'": ",formatSignature sig) @@ -626,8 +629,9 @@ application2String(op,argl, linkInfo) == (op' := isInternalFunctionName(op)) => op' app2StringWrap(formWrapId op, linkInfo) 1=#argl => - first argl is ["<",:.] => concat(op,first argl) - concat(app2StringWrap(formWrapId op, linkInfo)," ",first argl) + arg := first argl + arg is ["<",:.] or arg is ["(",:.] => concat(op,arg) + concat(app2StringWrap(formWrapId op, linkInfo)," ",arg) --op in '(UP SM) => -- newop:= (op = "UP" => "P";"M") -- concat(newop,concat(lbrkSch(),argl.0,rbrkSch(),argl.1)) diff --git a/src/interp/g-cndata.boot b/src/interp/g-cndata.boot index 285dc570..2477c18f 100644 --- a/src/interp/g-cndata.boot +++ b/src/interp/g-cndata.boot @@ -232,9 +232,14 @@ condAbbrev(arglist,argtypes) == res condUnabbrev(op,arglist,argtypes,modeIfTrue) == - #arglist ^= #argtypes => + #arglist ^= #argtypes and argtypes isnt [["Tuple",t]] => throwKeyedMsg("S2IL0014",[op,plural(#argtypes,'"argument"), bright(#arglist)]) + -- fix up argument list for unary constructor taking tuples. + t ^= nil => + categoryForm? t => + [["tuple",:[unabbrev1(arg,modeIfTrue) for arg in arglist]]] + [["tuple",:arglist]] [newArg for arg in arglist for type in argtypes] where newArg() == categoryForm?(type) => unabbrev1(arg,modeIfTrue) arg diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot index 7b8acc7f..1038901c 100644 --- a/src/interp/i-resolv.boot +++ b/src/interp/i-resolv.boot @@ -244,6 +244,8 @@ resolveTTSpecial(t1,t2) == dom' := resolveTT(dom, t2) null dom' => nil ['Segment, dom'] + member(t1,[$Domain,$Category]) and t2 = $Type => t2 + t1 = $Domain and t2 = $Category => $Type nil resolveTTCC(t1,t2) == -- cgit v1.2.3