Exercise 1.2
Translate the following expression into prefix form
5+4+(2-(3-(6+4/5)))/3(6-2)(2-7)
(/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7))) ->-0.246
Exercise 1.1
I just write the results...
10 ->10 (+ 5 3 4) ->12 (- 9 1) ->8 (/ 6 2) ->3 (+ (* 2 4) (- 4 6)) ->6 (define a 3) (define b (+ a 1)) (+ a b (* a b)) ->19 (= a b) ->false (if (and (> b a) (< b (* a b))) b a) ->4 (cond ((= a 4) 6) ((= b 4) (+ 6 7 a)) (else 25)) ->16 (+ 2 (if (> b a) b a)) ->6 (* (cond ((> a b) a) ((< a b) b) (else -1)) (+ a 1)) ->16
久々の更新…SICP。
更新が前回から開いてしまいました…。
本当ならば、毎日更新できるのが理想なんですがなかなかそうもいかず。
就職活動も終わりましたので、ぼちぼち時間作ってやります!
スローペースになりそうですが。。。
1.1 The Elements of Programming
prefix notation : 前置記法
pretty-printing : 改行を入れるなどして、コードをフォーマットして書くこと
[1.1.2 Naming and the Environment] はSchemeでの関数名の規約や評価法が書いてある。
Schemeの一般的な関数定義
(define (<name> <fomal parameters>) <body>)
式の評価順について
・normal-order evaluation
fully expand and then reduce
・applicative-order evaluation
evaluate the arguments and then apply
Lisp uses applicative-order evaluation
・cond 文
(cond (<p1> <e1>) (<p2> <e2>) … (<pn> <en>))
clause : 節 …(
predicate : 述語…
上から評価し、
もし、全ての
・if 文
(if <predicate> <consequent> <alternative>)
SICPの勉強。
勉強を始めたのが、1か月も前だから最初の方は記憶がちょっと曖昧。。
■
買う時から問題多発。
Apple Storeに行くも、「credit card でないと購入できない。」と言われる。
旅行中でカードの限度額に近かったので、購入は無理かと諦めかけた時に相方に助けてもらいなんとか購入。
相方に感謝!
そんなこんなで日本に持ち帰り、いざ火入れ。
…そう。AT&Tとの契約が大前提のこの携帯。初期設定が普通では出来ません。
activateをどうにかせよとな。
ここでiNdependenceというfreeソフトを使う。
が。何故か上手くいかず。
ちなみに訳もわからずファームウェアを1.1.3から1.1.4へ上げる。
上手くいかない原因を特定出来なかったため次のソフトを探す。
見つかったのがZiphone(2.5)。
ボタン一つで脱獄完了。
今現在は、様々なソフトをinstallしているところでございます。
OpenSSHが何故か動かないのが不満。
良い解決方法があればいい。