Merhabalar herkese...
/***********************************/
(defun increment-count (feature type)
(ecase type
(ham (incf (ham-count feature)))
(spam (incf (spam-count feature)))))
The ECASE construct is a variant of CASE, both of
which are similar to case statements in
Algol-derived languages (renamed switch in C and its
progeny). They both evaluate their first
argumentthe key formand then find the clause whose
first elementthe keyis the same
value according to EQL.
/**************************************/
Bu yukaridaki paragrafi PCL (Seibel) sayfa 296'da
buldum.
Nereden esti derseniz, soyle:
Ben case makrosu ile oynarken acaba C'deki default:'un
dengi ne olabilir diye dusundum ve (tembellikten
hyperspec'e filan bakmayip :)) "cond" ile bu birbirine
benziyorlar dedim; (t ...) yazdim, oldu. Ama sonra,
"bunun calismamasi lazim!" dedim, ve "otherwise"'i
buldum hyperspec'ten. Orada (t ...)'den bahsediliyorsa
bile ben kacirdim sanirim. Sonra Lambert'in kitabina
baktim, birsey bulamadim. Ardindan Seibel'in kitabinda
yukaridaki aciklamayi buldum. Fakat ayni kitabin 462.
sayfasindaki bir ornekte ayni benim yaptigim gibi (t
...) kullaniliyor. Problem su ki, yukaridaki aciklama
ya eksik/yanlis (cunku type'in sonucu T olmasa bile (t
...) formu otherwise niyetine calistiriliyor), veya (t
...) formu (otherwise ...) gibi calismamali, VEYA ben
birseyi kaciriyorum :/.
Biliyorum, pek onemli degil pratik acidan: ama yine de
birisi beni aydinlatirsa cok sevinirim. Simdiden
tesekkurler.
Nusret
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
cs-lisp mailing list
[email protected]
http://church.cs.bilgi.edu.tr/lcg
http://cs.bilgi.edu.tr/mailman/listinfo/cs-lisp