Changeset 5081:86b312aa1068
- Timestamp:
- 06/20/07 22:37:05 (6 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/interfaces/lisp.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/interfaces/lisp.py
r5080 r5081 23 23 '8' 24 24 25 One can define functions and the interface supports object-oriented 26 notation for calling them: 27 sage: lisp.eval('(defun factorial (n) (if (= n 1) 1 (* n (factorial (- n 1)))))') 28 'FACTORIAL' 29 sage: lisp('(factorial 10)') 30 3628800 31 sage: lisp(10).factorial() 32 3628800 33 sage: a = lisp(17) 34 sage: a.factorial() 35 355687428096000 36 25 37 AUTHORS: 26 -- William Stein (template) 38 -- William Stein (first version) 39 -- William Stein (2007-06-20): significant improvements. 27 40 """ 28 41 … … 91 104 code = str(code) 92 105 code = code.strip() 106 code = code.replace('\n',' ') 93 107 x = [] 94 108 for L in code.split('\n'):
Note: See TracChangeset
for help on using the changeset viewer.
