00001 // +-------------------------------------------------------------------------+ 00002 // | I__n__t__e__L__i__b 0.6.10 development | 00003 // | Copyright (c) Andrey Vikt. Stolyarov <crocodil_AT_croco.net> 2000-2007. | 00004 // | | 00005 // | This is free software. The library part is available under | 00006 // | GNU LESSER GENERAL PUBLIC LICENSE v.2.1. | 00007 // | GNU LGPL v2.1 is found in docs/gnu_gpl2.txt, or at http://www.gnu.org | 00008 // | Please see also docs/readme.txt and visit http://www.intelib.org | 00009 // | | 00010 // | !!! THERE IS NO WARRANTY OF ANY KIND, NEITHER EXPRESSED NOR IMPLIED !!! | 00011 // +-------------------------------------------------------------------------+ 00012 00013 00014 00015 00024 #ifndef INTELIB_SCHFUN_HPP_SENTRY 00025 #define INTELIB_SCHFUN_HPP_SENTRY 00026 00027 #include "../sexpress/sexpress.hpp" 00028 #include "../sexpress/iexcept.hpp" 00029 #include "../genlisp/lispform.hpp" 00030 #include "schcont.hpp" 00031 00032 class SchExpressionSymbol; 00033 00035 class SchExpressionLambda : public SExpressionFunction { 00036 SchContextRef context; 00037 SReference lambda_list; 00038 SchExpressionSymbol **lambda_vector; 00039 SchExpressionSymbol *lambda_rest; 00040 SReference body; 00041 public: 00043 static IntelibTypeId TypeId; 00045 00052 SchExpressionLambda(const SchContextRef &a_cont, 00053 const SReference &lambda, const SReference& body); 00054 protected: 00055 virtual ~SchExpressionLambda(); 00056 00057 public: 00059 00069 virtual void DoApply(int paramc, 00070 const SReference *paramv, 00071 IntelibContinuation &cont) const; 00072 00074 SReference& GetBody() { return body; } 00075 00076 #if INTELIB_TEXT_REPRESENTATIONS == 1 00077 virtual SString TextRepresentation() const; 00078 #endif 00079 00080 private: 00081 void DoAnalyseLambdaList(const SReference &rest, int n); 00082 }; 00083 00084 #endif