热门问题
时间线
聊天
视角

Cadence SKILL

来自维基百科,自由的百科全书

Remove ads

Cadence SKILL是一種由Cadence公司設計的程式語言。它是LISP語言的一種分支。[1][2]

快速預覽 編程範型, 實作者 ...

SKILL最初是根據Franz Lisp發展而來,由加州大學柏克萊分校的Richard J. Fateman創造。[3]

語法

注釋

注釋可以像傳統的Lisp分號分隔,

(car mylist) ; Comment from semicolon to end of the line

或者像C-樣式注釋

/* Comment */   car(mylist)   /* Another comment */

程序定義

;; C style
procedure (factorial(n)
    if ( n <= 1 then
        1
    else
        n * factorial(n-1)
    )
)
;; LISP style
(procedure (factorial n)
    (if (leqp n 1)
        then 1
        else (times n (factorial (difference n 1)))))
;; Hybrid style
(procedure (factorial n)
    (if n <= 1
        then 1
        else n * (factorial n-1)))

參考資料

Loading content...
Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads