λ 何謂也?
λ 表達式的『核心』理念是︰將『函數』應用於其『引數』;藉『抽象』形成『函數』。用著『簡潔』的『語法』,專注於『表徵』函數;視『函數』為計算的『規則』,深得『計算』之『內蘊』。其『語詞』表達『疏落』大方,概念『表現力』與『柔軔性』十足。故為『邏輯』、『數學』和『程式』理念之『聚寶盆』!!
辨明『異同』與分解『差別』是學習的功夫︰
真積力,久則入。
讓我們再次『觀止』λ 表達式的『定義』︰
變元集合
抽象符號 『 λ 』與『 . 』,符號本身不是λ 表達項
結構括號 『 ( 』與『 ) 』,括號本身不是λ 表達項
λ 表達式的論域集合 ,由下面三條語法歸納定義︰
一、如果 ,那麼
二、如果 而且 ,那麼
三、如果 ,那麼
假使觀察一個合乎語法的 λ 表達式 ,然後問著『 』變元是指『什麼』?這個表達式最內層的 是函式的應用,明寫 是某個函式,然而如何計算卻隻字未提。如此看來,所謂的『變元』也可以是『函式』。那要怎麼『詮釋』那個『 λ表達式』呢?由於我們不知道 指的是什麼?也可以說它們『未被定義』,假使『給與定義』,我們或許可以講『在這個解釋下』,該個『 λ表達式』的『語意』是『□□□』。比方談著『用量角器量角度』一事,假使︰
用量角器量角度
東西的角度
,那麼 是說︰拿某種『待指定』的量角器來量『尚未說』之物的角度。
要是講到『計算某種三角函數的數值』時,設想︰
某種三角函數的計算
角度
,那麼 是說︰用某個『待指定』的三角函數來計算『未輸入』的角度。
……
由於每個『變元』的『論域』未被定義,所以各種『詮釋』都是『可能的』,因此說『函式建構』是『抽象』的,『應用化約』是廣義的『計算結構』之『同等性』。這也使得『應用化約』成為『 λ 運算』的『核心原則』,也就是說『 化約』是最重要的『轉換規則』。
─── 《Λ 運算︰概念導引《二》》
假使你還不知道『 表達式』是什麼?或可參讀
《Λ 運算︰概念導引…》系列文本。
至於如何用『球拍』打球,作者也是新手,只能跟著 racket 文件走
v7.2
Getting Started
To get started with Racket, download it from the web page and install it. If you are a beginner or would like to use a graphical environment to run programs, run theDrRacket executable. Otherwise, the racket executable will run a command-line Read-Eval-Print-Loop (REPL).
On Windows, you can start DrRacket from the Racket entry in the Start menu. In Windows Vista or newer, you can just type DrRacket. You can also run it from its folder, which you can find in Program Files → Racket → DrRacket.
On Mac OS, double click on the DrRacket icon. It is probably in a Racket folder that you dragged into your Applications folder. If you want to use command-line tools, instead, Racket executables are in the “bin” directory of the Racket folder (and if you want to set your PATH environment variable, you’ll need to do that manually).
On Unix (including Linux), the drracket executable can be run directly from the command-line if it is in your path, which is probably the case if you chose a Unix-style distribution when installing. Otherwise, navigate to the directory where the Racket distribution is installed, and the drracket executable will be in the “bin” subdirectory.
If you are new to programming or if you have the patience to work through a textbook:
- How to Design Programs, Second Edition is the best place to start.
- Continue: Web Applications in Racket introduces you to modules and building web applications.
- The Racket Guide describes the rest of the Racket language, which is much bigger than the learning-oriented languages of the textbook. Since you learned functional programming from the textbook, you’ll be able to skim chapters 1 and 2 of the Guide.
If you’re already a programmer and you’re in more of a hurry:
- Quick: An Introduction to Racket with Pictures gives you a taste of Racket.
- More: Systems Programming with Racket dives much deeper and much faster. If it’s too much, just skip to the Guide.
- The Racket Guide starts with a tutorial on Racket basics, and then it describes the rest of the Racket language.
Of course, you should feel free to mix and match the above two tracks, since there is information in each that is not in the other.
帶張鳥瞰小抄
先來點實際經驗
Quick: An Introduction to Racket with Pictures
This tutorial provides a brief introduction to the Racket programming language by using one of its picture-drawing libraries. Even if you don’t intend to use Racket for your artistic endeavours, the picture library supports interesting and enlightening examples. After all, a picture is worth five hundred “hello world”s.
Along the same lines, we assume that you will run the examples using DrRacket. Using DrRacket is the fastest way to get a sense of what the language and system feels like, even if you eventually use Racket with Emacs, vi, or some other editor.
…
再多練習!