From 9fbb89443e0c88ee5e76d95a3eea2ac5ea9916b6 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 19 Feb 2008 00:35:15 +0000 Subject: * algebra/variable.spad.pamphlet (AnonymousFunction): Add new functions `parameters' and `body'. * algebra/domain.spad.pamphlet: Rename from algebra/domain.spad. (Category): New category. * algebra/Makefile.pamphlet (axiom_algebra_layer_0): Include CATEGORY.o. (DOMAIN.NRLIB/code.$(FASLEXT)): Remove rule. * interp/trace.boot (transTraceItem): Use $LangSupportTypes. * interp/sys-constants.boot ($None): New. ($Type): Likewise. ($LangSupportTypes): Likewise. * interp/parse.boot (parseHas): Use $LangSupportTypes. (parseHasRhs): Likewise. * interp/i-spec2.boot (upLETtype): Use conceptualType. (uptypeOf): Likewise. (upwhere): Likewise. (typeOfType): Remove. * interp/i-spec1.boot (isDomainValuedVariable): Variables with type Category and Type are domain valued too. * interp/i-output.boot (output): Special case only Mode and Type. * interp/i-funsel.boot (selectMms): Don't ignore modemaps with category parameters. * interp/i-coerce.boot (canCoerce1): Test for Category instead of SubDomain Domain. (canCoerceFrom0): Use $None and $Any. (absolutelyCannotCoerce): Use $None. (coerceInteractive): Use $LangSupportTypes. (coerceInt1): Use $Any. * interp/i-analy.boot (conceptualType): New. (bottomUpType): Use it. * interp/clammed.boot (isValidType): Use $LangSupportTypes. * interp/g-cndata.boot (isNameOfType): Likewise. * interp/category.boot (Category): Remove hacky definition. * interp/buildom.boot ($noCategoryDomains): Domain now has a Lisplib. --- src/algebra/variable.spad.pamphlet | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/algebra/variable.spad.pamphlet') diff --git a/src/algebra/variable.spad.pamphlet b/src/algebra/variable.spad.pamphlet index 0f50171d..54972970 100644 --- a/src/algebra/variable.spad.pamphlet +++ b/src/algebra/variable.spad.pamphlet @@ -93,13 +93,30 @@ FunctionCalled(f:Symbol): SetCategory with )abbrev domain ANON AnonymousFunction ++ Description: ++ This domain implements anonymous functions -AnonymousFunction():SetCategory == add - coerce(x:%):OutputForm == x pretend OutputForm +AnonymousFunction():SetCategory with + parameters: % -> List Symbol + ++ parameters(f) returns the list of parameters bound by `f'. + body: % -> Syntax + ++ body(f) returns the body of the unnamed function `f'. + == add + import Syntax + coerce(x:%):OutputForm == + x pretend OutputForm + + parameters f == + ps := CADR(f)$Lisp : Syntax + ps case Symbol => [ps]$List(Symbol) + getOperands(ps) pretend List(Symbol) + + body f == + CADDR(f)$Lisp : Syntax @ \section{License} <>= ---Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +--Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd. +--All rights reserved. +--Copyright (C) 2007-2008, Gabriel Dos Reis. --All rights reserved. -- --Redistribution and use in source and binary forms, with or without -- cgit v1.2.3