Discussion:
4: "defun" kullanmayi denemistim zaten..
ÿffffe7aÿfffff0layan
2007-11-06 08:52:45 UTC
Permalink
(defun akor-salla
(let* ((t (random 116))
(m (+ t (random 3) 2))
(d (+ t (random 3) 5)))
(list t m d)))
AKOR-SALLA
CG-USER(3): (akor-salla)
Error: AKOR-SALLA got 0 args, wanted 3 args.

||"defun" kullan cevabinin sonucu.||

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Emre Sevinc
2007-11-06 09:16:23 UTC
Permalink
-----Original Message-----
Sent: Tuesday, November 06, 2007 10:53 AM
To: lisp grup
Subject: [cs-lisp] re:4: "defun" kullanmayi denemistim zaten..
(defun akor-salla
(let* ((t (random 116))
(m (+ t (random 3) 2))
(d (+ t (random 3) 5)))
(list t m d)))
AKOR-SALLA
CG-USER(3): (akor-salla)
Error: AKOR-SALLA got 0 args, wanted 3 args.
||"defun" kullan cevabinin sonucu.||
Eger verdigim cevaptaki Lisp kilavuzlarini takip edersen, misal HyperSpec'i, bir ornekte goreceksin ki:

(defun recur (x)
(when (> x 0)
(recur (1- x)))) => RECUR

Burada recur, x isimli bir arguman aliyor. Eger fonksiyon hic arguman almiyorsa o zaman arguman listesi bos bir liste olacaktir, yani:

(defun akor-salla ()
...

seklinde baslamak icap eder. Dolayisi ile su sekilde yazarsak calistirabiliriz:

(defun akor-salla ()
(let* ((z (random 116))
(m (+ z (random 3) 2))
(d (+ z (random 3) 5)))
(list z m d)))

CG-USER(1): (akor-salla)
(20 22 27)
CG-USER(2): (akor-salla)
(36 40 43)
CG-USER(3): (akor-salla)
(14 17 19)

Bu bilgi yeterli oldu mu acaba?
--
Emre Sevinc

e-MBA Software Development @ Istanbul Bilgi University
http://www.bilgi.edu.tr
http://www.bilgiemba.net

http://www.cogsci.boun.edu.tr
http://ileriseviye.org/blog
http://fazlamesai.net
http://cazci.com
Loading...