mce-testcases.scm

来自「用JAVA实现的小的学生管理系统.JAVA与数据库的结合使用.」· SCM 代码 · 共 63 行

SCM
63
字号
;##################################################
; GdI 1/ICS 1 WS 04/05
; Uebung/Exercise 13 - Aufgabe/Task 4
;--------------------------------------------------
; Testcases
;##################################################

;##################################################
; Load scheme interpreter
(load "mce-extension.scm")

; Creates the global environment
(define the-global-environment (setup-environment))

;###### test-cases or:##########

(display "(or false false): #f")
(eval  '(or false false) the-global-environment) 

(display "(or false true): #t")
(eval  '(or false true) the-global-environment) 

(display "(or false false true false): #t")
(eval  '(or false false true false) the-global-environment) 

(display "(or): #f")
(eval  '(or) the-global-environment) 

;###### test-cases and:##########

(display "(and false false): #f")
(eval  '(and false false) the-global-environment) 

(display "(and false true): #f")
(eval  '(and false true) the-global-environment) 

(display "(and true false): #f")
(eval  '(and true false) the-global-environment) 

(display "(and false false true false): #f")
(eval  '(and false false true false) the-global-environment) 

(display "(and true true true): #t")
(eval  '(and true true true) the-global-environment) 

(display "(and): #t")
(eval  (and) the-global-environment) 


;##### let-cases: ########

(display "(let ((x true) (y true)) (and y x)) :true )")
(eval '(let ((x true) (y true)) (and y x)) the-global-environment)

(display "(let ((x 3) (y 4) (z 8)) (- (+ y x) z)) : -1")
(eval '(let ((x 3) (y 4) (z 8)) (- (+ y x) z)) the-global-environment)

;###### test-cases mixed:##########

(display "(and true (if (and true true) false true)): #f")
(eval  '(and true (if (and true true) false true)) the-global-environment) 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?