⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 date.clp

📁 基于专家系统课程设计的CLISP实现实例
💻 CLP
字号:
; This is the date function 
; for reasons of computational simplicity, the date is represented
; as an integer which represents days since jan 1 1900.

; because CLIPS does not capture the return of system calls, the intermediate
; value is stored in a file.
(deffunction get-now ()
	(system "date '+%y%t%j' > datefile.dat")
	(open "datefile.dat" datefile "r")
	(bind ?year (read datefile))
	(bind ?day (read datefile))
	(close datefile)
	( +(div ?year 4) (* ?year 365)  ?day)
)

(deffunction elapsed-time (?date)
	(- (get-now) ?date))

; is date more than 6 mo ago?
(deffunction six-months (?date)
	(< 180 (elapsed-time ?date)))

; is date more than 5 years ago?
(deffunction five-years (?date)
	(< 1826 (elapsed-time ?date)))

⌨️ 快捷键说明

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