The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5fcae5eb66
commit
12a43edc2d
1508 changed files with 125983 additions and 44037 deletions
|
|
@ -1,23 +1,14 @@
|
|||
;;;
|
||||
;;; Guile script for simple example.
|
||||
;;; Is a little clumsy since I'm not the greatest scheme programmer.
|
||||
;;;
|
||||
;;; example.scm
|
||||
|
||||
(display (get-time))
|
||||
(display "My variable = ")
|
||||
(display (My-variable))
|
||||
(newline)
|
||||
(define (mdisplay-newline . args) ; does guile-1.3.4 have `format #t'?
|
||||
(for-each display args)
|
||||
(newline))
|
||||
|
||||
(define (facts x max)
|
||||
(if (< x max)
|
||||
(begin
|
||||
(display (string-append (number->string x) " factorial is "
|
||||
(number->string (fact x))))
|
||||
(newline)
|
||||
(facts (+ x 1) max))))
|
||||
|
||||
(facts 0 14)
|
||||
(mdisplay-newline (get-time) "My variable = " (My-variable))
|
||||
|
||||
(do ((i 0 (1+ i)))
|
||||
((= 14 i))
|
||||
(mdisplay-newline i " factorial is " (fact i)))
|
||||
|
||||
(define (mods i imax j jmax)
|
||||
(if (< i imax)
|
||||
|
|
@ -27,9 +18,11 @@
|
|||
(mods i imax (+ j 1) jmax))
|
||||
(mods (+ i 1) imax 1 jmax))))
|
||||
|
||||
(mods 1 250 1 250)
|
||||
(mods 1 150 1 150)
|
||||
|
||||
(display (string-append "My-variable = " (number->string (My-variable))))
|
||||
(newline)
|
||||
(mdisplay-newline "My-variable = " (My-variable))
|
||||
|
||||
(exit (and (= 1932053504 (fact 13))
|
||||
(= 745470.0 (My-variable))))
|
||||
|
||||
;;; example.scm ends here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue