0
0
Loading version...
🔄 Update App
🔍 Check for Updates
Test Notification
🔔 Enable Notifications
📰 Fetch NHK News
🚀 Fetch TechCrunch News
🧪 Experiment
📰 Article Management
📚 Reading List
🎤 Speaking List
📊 Statistics
💻 Software Statistics
Push Admin
Edit Reading
Back to List
Basic Information
Title
Please enter a title.
URL
Please enter a valid URL.
Date
カテゴリID
画像ファイル名
統計情報
単語数:
395語
読了回数:
0回
作成日:
2022/01/06 20:17
更新日:
2025/12/09 18:20
本文
本文
Lisp (used to be called LISP) is a programming language. It is among the oldest programming languages that are still used today. Only Fortran is one year older. Lisp was designed by John McCarthy in 1958. The best-known versions of LISP are Common Lisp, Scheme and Clojure. Many concepts that are used in modern programming languages were first created in Lisp. Linked lists are a very important data structure in Lisp. The basic concepts behind Lisp are easy to learn. Logo is another version of Lisp that was made for children. Logo can help young children develop skills and become efficient within the programming language. Simple examples (Scheme) Edit In Lisp, operations are written in prefix notation, and they start and end with parentheses. For example, the formula {\displaystyle {\frac {3+5}{4}}}{\displaystyle {\frac {3+5}{4}}} is written as: (/ (+ 3 5) 4) ; returns 2 Because Lisp is a functional language, Lisp programs often use recursion to solve problems. Here is a Scheme program that finds the factorial of a number. The function (factorial n) starts by testing if {\displaystyle n=0}{\displaystyle n=0} or not. If {\displaystyle n=0}{\displaystyle n=0}, then (factorial 0) is 1. If {\displaystyle n\neq 0}{\displaystyle n\neq 0}, then (factorial n) returns the product of {\displaystyle n}n and the factorial of {\displaystyle n-1}{\displaystyle n-1}. (define (factorial n) (if (= n 0) 1 (* n (factorial (- n 1))))) (factorial 6) ; returns the factorial of 6: 6! = 6*5*4*3*2*1 = 720 Linked lists are an important idea in Lisp. The list without any things in it is known as the empty or nil list, and is written as '(). A list that has things in it is written as '(dog cat). The operation car is used to get the first thing of a list. For example, (car '(dog cat fish)) ; returns 'dog, which is the first thing in the list (car '(1 2 3 4 5 6 7)) ; returns 1 (car '()) ; this code gives an error because the list is empty/nil The operation cdr returns everything in the list except for the first thing. (cdr '(dog cat fish)) ; returns '(cat fish) (cdr '(6)) ; returns '(), because there is nothing in the list after the first thing (6) (cdr '()) ; gives an error because the list is empty/nil Here is a hello world program in Scheme: (display "Hello world!")
本文を入力してください。
メモ
メモ・感想
キャンセル
更新
Debug Info:
Saved State:
-
Redirected Flag:
-
Current URL:
-
Refresh
Close
Debug
Send Report
Send Report
Draw Arrow
Clear
Message:
Cancel
Send