"********************************************************************************** * The License * * * * The user is free to produce commercial applications with the software, to * * distribute these applications in source or binary form, and to charge monies * * for them as he sees fit and in concordance with the laws of the land subject * * to the following license. * * * * 1. The license applies to all the software and all derived software and * * must appear on such. * * * * 2. It is illegal to distribute the software without this license attached * * to it and use of the software implies agreement with the license as such. * * It is illegal for anyone who is not the copyright holder to tamper with * * or change the license. * * * * 3. Neither the names of Lambda Associates or the copyright holder may be used * * to endorse or promote products built using the software without specific * * prior written permission from the copyright holder. * * * * 4. That possession of this license does not confer on the copyright holder * * any special contractual obligation towards the user. That in no event * * shall the copyright holder be liable for any direct, indirect, incidental, * * special, exemplary or consequential damages (including but not limited * * to procurement of substitute goods or services, loss of use, data, * * interruption), however caused and on any theory of liability, whether in * * contract, strict liability or tort (including negligence) arising in any * * way out of the use of the software, even if advised of the possibility of * * such damage. * * * * 5. It is permitted for the user to change the software, for the purpose of * * improving performance, correcting an error, or porting to a new platform, * * and distribute the derived version of Shen provided the resulting program * * conforms in all respects to the Shen standard and is issued under that * * title. The user must make it clear with his distribution that he/she is * * the author of the changes and what these changes are and why. * * * * 6. Derived versions of this software in whatever form are subject to the same * * restrictions. In particular it is not permitted to make derived copies of * * this software which do not conform to the Shen standard or appear under a * * different title. * * * * It is permitted to distribute versions of Shen which incorporate libraries, * * graphics or other facilities which are not part of the Shen standard. * * * * For an explication of this license see www.shenlanguage.org/license.htm which * * explains this license in full. * * * ***************************************************************************************** "(defun load (V827) (let Load (let Start (get-time run) (let Result (shen.load-help (value shen.*tc*) (read-file V827)) (let Finish (get-time run) (let Time (- Finish Start) (let Message (shen.prhush (cn " run time: " (cn (str Time) " secs ")) (stoutput)) Result))))) (let Infs (if (value shen.*tc*) (shen.prhush (cn " typechecked in " (shen.app (inferences) " inferences " shen.a)) (stoutput)) shen.skip) loaded))) (defun shen.load-help (V832 V833) (cond ((= false V832) (map (lambda X (shen.prhush (shen.app (shen.eval-without-macros X) " " shen.s) (stoutput))) V833)) (true (let RemoveSynonyms (mapcan shen.remove-synonyms V833) (let Table (mapcan shen.typetable RemoveSynonyms) (let Assume (map shen.assumetype Table) (trap-error (map shen.typecheck-and-load RemoveSynonyms) (lambda E (shen.unwind-types E Table))))))))) (defun shen.remove-synonyms (V834) (cond ((and (cons? V834) (= shen.synonyms-help (hd V834))) (do (eval V834) ())) (true (cons V834 ())))) (defun shen.typecheck-and-load (V835) (do (nl 1) (shen.typecheck-and-evaluate V835 (gensym A)))) (defun shen.typetable (V844) (cond ((and (cons? V844) (and (= define (hd V844)) (cons? (tl V844)))) (let Sig (compile shen. (tl (tl V844)) ()) (if (= Sig (fail)) (simple-error (shen.app (hd (tl V844)) " lacks a proper signature. " shen.a)) (cons (cons (hd (tl V844)) Sig) ())))) ((and (cons? V844) (and (= defcc (hd V844)) (and (cons? (tl V844)) (and (cons? (tl (tl V844))) (and (= { (hd (tl (tl V844)))) (and (cons? (tl (tl (tl V844)))) (and (cons? (hd (tl (tl (tl V844))))) (and (= list (hd (hd (tl (tl (tl V844)))))) (and (cons? (tl (hd (tl (tl (tl V844)))))) (and (= () (tl (tl (hd (tl (tl (tl V844))))))) (and (cons? (tl (tl (tl (tl V844))))) (and (= ==> (hd (tl (tl (tl (tl V844)))))) (and (cons? (tl (tl (tl (tl (tl V844)))))) (and (cons? (tl (tl (tl (tl (tl (tl V844))))))) (= } (hd (tl (tl (tl (tl (tl (tl V844)))))))))))))))))))))) (cons (cons (hd (tl V844)) (cons (hd (tl (tl (tl V844)))) (cons ==> (cons (hd (tl (tl (tl (tl (tl V844)))))) ())))) ())) ((and (cons? V844) (and (= defcc (hd V844)) (cons? (tl V844)))) (simple-error (shen.app (hd (tl V844)) " lacks a proper signature. " shen.a))) (true ()))) (defun shen.assumetype (V845) (cond ((cons? V845) (declare (hd V845) (tl V845))) (true (shen.sys-error shen.assumetype)))) (defun shen.unwind-types (V850 V851) (cond ((= () V851) (simple-error (error-to-string V850))) ((and (cons? V851) (cons? (hd V851))) (do (shen.remtype (hd (hd V851))) (shen.unwind-types V850 (tl V851)))) (true (shen.sys-error shen.unwind-types)))) (defun shen.remtype (V852) (set shen.*signedfuncs* (shen.removetype V852 (value shen.*signedfuncs*)))) (defun shen.removetype (V857 V858) (cond ((= () V858) ()) ((and (cons? V858) (and (cons? (hd V858)) (= (hd (hd V858)) V857))) (shen.removetype (hd (hd V858)) (tl V858))) ((cons? V858) (cons (hd V858) (shen.removetype V857 (tl V858)))) (true (shen.sys-error shen.removetype)))) (defun shen. (V864) (let Result (let Parse_shen. (shen. V864) (if (not (= (fail) Parse_shen.)) (let Parse_ ( Parse_shen.) (if (not (= (fail) Parse_)) (shen.pair (hd Parse_) (shen.hdtl Parse_shen.)) (fail))) (fail))) (if (= Result (fail)) (fail) Result))) (defun write-to-file (V865 V866) (let Stream (open file V865 out) (let String (if (string? V866) (shen.app V866 " " shen.a) (shen.app V866 " " shen.s)) (let Write (pr String Stream) (let Close (close Stream) V866)))))