From 3453d3a52c3809ffd6b5f80d3ab71dde4b9ba8e1 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Wed, 6 Jan 2016 23:25:26 -0800 Subject: Remove $insideCategoryIfTrue. Replace with call to new function dbForCategory? --- src/ChangeLog | 7 +++++++ src/interp/c-util.boot | 6 +++++- src/interp/compiler.boot | 2 +- src/interp/database.boot | 2 +- src/interp/define.boot | 4 +--- src/interp/sys-globals.boot | 5 +---- 6 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 89e40198..9c1205bb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2016-01-06 Gabriel Dos Reis + + * interp/c-util.boot (dbForCategory?): New. Use in lieu of + removed $insideCategoryIfTrue. + * interp/sys-globals.boot ($insideCategoryIfTrue): Remove. Adjust + users. + 2016-01-06 Gabriel Dos Reis * interp/define.boot (macroExpand): Do not expand the definiendum, diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index 84b6df23..58706ec0 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2015, Gabriel Dos Reis. +-- Copyright (C) 2007-2016, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -225,6 +225,10 @@ macro dbSubstituteQueries(db,x) == dbSubstituteAllQuantified(db,x) == applySubst([:dbQuerySubst db,:dbFormalSubst db],x) +++ This predicate holds if this DB is for a category constructor. +dbForCategory? db == + db ~= nil and dbConstructorKind db is 'category + --% $SetCategory == '(SetCategory) diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 4825382a..0ff039f3 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1697,7 +1697,7 @@ compColon([":",f,t],m,e) == t:= t isnt [.,:.] and (t':= assoc(t,getDomainsInScope e)) => t' t = $Category and categoryInstance? f => t - isDomainForm(t,e) and not $insideCategoryIfTrue => + not dbForCategory? db and isDomainForm(t,e) => e := addDomain(db,t,e) t isDomainForm(t,e) or isCategoryForm(t,e) => t diff --git a/src/interp/database.boot b/src/interp/database.boot index be21edfe..7f0d11b3 100644 --- a/src/interp/database.boot +++ b/src/interp/database.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2013, Gabriel Dos Reis. +-- Copyright (C) 2007-2016, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without diff --git a/src/interp/define.boot b/src/interp/define.boot index 767521ab..63a5f31c 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -843,7 +843,6 @@ compDefine1(db,form,m,e) == (sig := getSignatureFromMode(lhs,e)) => -- here signature of lhs is determined by a previous declaration compDefine1(db,['DEF,lhs,[sig.target,:signature.source],rhs],m,e) - if signature.target=$Category then $insideCategoryIfTrue:= true -- RDJ (11/83): when argument and return types are all declared, -- or arguments have types declared in the environment, @@ -1109,7 +1108,6 @@ compDefineCategory2(db,form,signature,body,m,e,$formalArgList) == --1. bind global variables $prefix: local := nil $op: local := form.op - $insideCategoryIfTrue: local := true $definition: local := form --used by DomainSubstitutionFunction $form: local := nil $extraParms: local := nil @@ -2339,7 +2337,7 @@ compCapsuleInner(db,itemList,m,e) == if $addForm ~= nil then data := ['add,$addForm,data] code := - $insideCategoryIfTrue and not $insideCategoryPackageIfTrue => data + dbForCategory? db => data buildFunctor(db,$signature,data,localParList,e) [MKPF([:$getDomainCode,code],"PROGN"),m,e] diff --git a/src/interp/sys-globals.boot b/src/interp/sys-globals.boot index ae2d5f80..65aa9a4f 100644 --- a/src/interp/sys-globals.boot +++ b/src/interp/sys-globals.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2014, Gabriel Dos Reis. +-- Copyright (C) 2007-2016, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -105,9 +105,6 @@ $inLispVM := true ++ $insideCapsuleFunctionIfTrue := false -++ -$insideCategoryIfTrue := false - ++ $insideCoerceInteractiveHardIfTrue := false -- cgit v1.2.3