From e4d42fad6ae663b5fdae7d6fae8f3aba51575849 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 19 Feb 2012 21:53:52 +0000 Subject: * interp/compiler.boot (compBuiltinDomain): Compute the exports from parentsOfBuiltinInstance. * interp/buildom.boot (parentsOfBuiltinInstance): Tidy. --- src/ChangeLog | 6 ++++++ src/interp/buildom.boot | 8 ++++---- src/interp/compiler.boot | 8 ++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 27687105..32ed8418 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-02-19 Gabriel Dos Reis + + * interp/compiler.boot (compBuiltinDomain): Compute the exports + from parentsOfBuiltinInstance. + * interp/buildom.boot (parentsOfBuiltinInstance): Tidy. + 2012-02-19 Gabriel Dos Reis * interp/compiler.boot (compBuiltinDomain): Rename from compCat. diff --git a/src/interp/buildom.boot b/src/interp/buildom.boot index 1acc3560..449ae06f 100644 --- a/src/interp/buildom.boot +++ b/src/interp/buildom.boot @@ -696,10 +696,10 @@ parentsOfBuiltinInstance form == op is 'MappingCategory => nil -- [[$Type,:true]] op is 'EnumerationCategory => [[$SetCategory,:true]] -- builtin domains - op is 'Mapping => [['MappingCategory,:args],:true] - op is 'Record => [['RecordCategory,:args],:true] - op is 'Union => [['UnionCategory,:args],:true] - op is 'Enumeration => [['EnumerationCategory,:args],:true] + op is 'Mapping => [[['MappingCategory,:args],:true],[$SetCategory,:true]] + op is 'Record => [[['RecordCategory,:args],:true]] + op is 'Union => [[['UnionCategory,:args],:true]] + op is 'Enumeration => [[['EnumerationCategory,:args],:true]] nil $CapitalLetters == diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 83112679..06c617be 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2011, Gabriel Dos Reis. +-- Copyright (C) 2007-2012, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -2027,8 +2027,12 @@ compBuiltinDomain(form is [functorName,:argl],m,e) == fn := property(functorName,"makeFunctionList") or return nil diagnoseUnknownType(form,e) [funList,e]:= FUNCALL(fn,form,form,e) + exports := [cat for x in parentsOfBuiltinInstance form] + where cat() == + x.rest is true => x.first + ['IF,x.rest,['ATTRIBUTE,x.first],'%noBranch] catForm:= - ["Join",$SetCategory,["CATEGORY","domain",: + ["Join",:exports,["CATEGORY","domain",: [["SIGNATURE",op,sig] for [op,sig,.] in funList | op~="="]]] --RDJ: for coercion purposes, it necessary to know it's a Set; I'm not --sure if it uses any of the other signatures(see extendsCategoryForm) -- cgit v1.2.3