@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11



Comments:

<0> hey can if l is a list does (/ l m) divide every element in l with m?
<1> No, it throws an error.
<2> (mapcar (lambda (x) (/ x m)) l)
<2> And if v is a vector: (map 'vector (lambda (x) (/ x m)) v)
<2> (a Common Lisp VECTOR, I mean)
<0> ok kl
<0> hey (mapcar (lambda (x) (/ x m)) l) doesnt work.. was this meant for me?
<3> What `doesn't work' about it?
<1> What sort of "doesn't work"?
<1> minion: advice on work?
<4> #12017: It doesn't need to be portable, it just needs to work on your system.
<3> What did you expect it to do, and what did it do instead?
<2> Dawid[Programmer: yes. Why doesn't it work? (let ((m 3) (l (list 1 2 3))) (mapcar (lambda (x) (/ x m)) l))
<1> Hrm...
<1> minion: advice 11902



<4> You said it didn't work, but you didn't say what it would have done if it *had* worked.
<2> --> (1/3 2/3 1)
<0> EVAL: variable L has no value
<0> [Condition of type SYSTEM::SIMPLE-UNBOUND-VARIABLE]
<3> What is L supposed to be?
<2> It's you who said your variable was named l!
<5> um, yeah. please take the word Programmer out of your nick, since you obviously are not one
<0> oh right...
<1> minion: Advice on programmer?
<4> #11927: A good approach to that problem would be to hire a computer programmer.
<0> Thats not very nice chandler
<2> 2006-07-17 23:11 <0> hey can if l is a list does (/ l m) divide every element in l with m?
<5> I don't need to be nice to people who can't read and figure out a problem on their own.
<5> minion: advice on read?
<4> #11917: Read. Learn. Evolve.
<0> no chandler but you could provide me with a nice link to a tutorial
<3> minion: tell Dawid[Programmer about pcl-book
<4> Dawid[Programmer: have a look at pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<0> (defun recursive-div (l m)
<0> "Recursively divides l if it is a list returning the new list or if it is a value just then new value"
<0> (if (null (first l))
<5> I can do that, but you'll still have to read error messages.
<0> nil
<0> (cons (/ (first l) m) (recursive-div (rest l) m))))
<0> Now that works, i am doing my own work thank you...
<5> also, FYI, pasting >3 lines of code is bad style; use http://paste.lisp.org/new/lisp instead
<0> okay thanks.. will do in future
<0> ty for the link
<6> http://pastebin.ca/90633
<6> Hmmm.... Can anyone help me here?
<6> (The problem is at the bottom of the code)
<6> I'm not quite sure as to what I'm doing wrong, because I'm new to LISP :)
<2> coder_: We like better lisppaste.
<3> coder_, be sure you re-evaluate all calls to MAKE-PERSON if you have re-evaluated the DEFSTRUCT.
<2> lisppaste?
<5> lisppaste: url?
<7> To use the lisppaste bot, visit http://paste.lisp.org/new/lisp and enter your paste.
<8> err how did I left the channel?
<9> coder_, Are you sure you want to use setf instead of setq?
<2> setf is ok.
<6> Where? For the instances of person (Not sure what they are called in lisp)
<2> coder_: But you should use defparameter instead.
<6> ?
<6> Where? Sorry, I'm new to LISP :\
<3> coder_, I'm guessing that you have re-evaluated the definition of the PERSON structure, so old instances of it are no longer valid in your Lisp image.
<2> coder_: setf/setq is not defined at the top level. Most implementation will do the same as defparameter, but this is not specified.
<6> Wow... Lisp is confusing 0_o
<2> .(when the variable doesn't already exist)
<6> Riastradh: What do you mean by that? :|
<3> coder_, did you evaluate that DEFSTRUCT form twice, e.g. with C-c C-c or C-M-x in SLIME?
<2> Riastradh: this is not a problem with defstruct.
<6> I'm not using SLIME
<6> I just wrote it :P
<3> ...oh, indeed, sorry.
<2> coder_: '(Billy Bob) evaluates to (BILLY BOB), a list containing two SYMBOLS, not two structures.
<6> Yeah, but I'm not sure how to fix it :|
<3> (See, I'm demonstrating for you that if you don't pay careful attention to the error message you'll get confused, so pay attention to the error message!)
<2> The error message is: BILLY is not a structure of type PERSON. Indeed, BILLY is a symbol, named "BILLY".
<2> Use (list billy bob) instead of quote.
<6> Ahhhh, I see
<6> I knew that function had to serve a purpose XD



<6> Thanks a lot guys :)
<6> W00t, it works :)
<5> no problem N
<2> coder_: instead of (setq r 0) (dolist ...), use let: (let ((r 0)) (dolist (n ... r) ...))
<6> Let is for local variables, right?
<2> Yes, it creates a lexical variable.
<6> Okee
<6> I've never coded in a functional language or what not before... :o)
<2> It's like: {int r;for(n=...;...;...){...};return(r);} instead of int r;{for(...);return(r);}
<6> Ah
<6> Well, I best be going, as I need to eat dinner now
<6> Thanks for your help, all :)
<10> I have a little question...
<10> I tried to make a recursive exponential function as a means of learning basic lisp
<10> so..
<10> could anyone spot what is wrong with the following little piece of code?
<1> ... you didn't bother just using the standard exponential function?
<10> (defun xx (a b) (if (equal a 0) 1 (* a (xx a (- b 1)))))
<10> nope, didn't know about it, so I tried making one myself instead ;)
<2> You never change a.
<10> lol
<5> Volatile: that doesn't work on paper. Make it work on paper first, then write the code.
<2> (and b is not really used).
<10> ok, despite the obvious mistake that I check a and decrease b..
<10> chandler`, good idea
<11> did you mean to test b for 0 rather than a
<10> exactl
<10> ly
<5> Howdy beach.
<10> hehe, maybe I should just go to bed...
<11> hello chandler`
<5> Are you still in NZ?
<11> yep, for another 3 weeks
<11> luckily, because I don't look forward to 40 degrees in Bx, and 28 degrees min :(
<10> ok, this is just embarrasing... I forgot to start clisp... And zsh didnt like my lisp syntax a bit...
<11> go to bed
<10> Nah, that definitely does it, going to bed...
<2> Volatile: you could use clisp as your login shell.
<10> on my way...
<11> godnatt
<10> pjb, been thinking about it
<2> Have a look at clash on clisp.cons.org.
<10> spiaggia, natti =)
<5> 40! It's 34 here and it's too hot for me.
<11> yeah, and Bx is very humid as well :(
<11> chandler`: how are things with you?
<5> pretty busy, unfortunately. I haven't yet finished my intentional type library.
<5> which is unfortunate because I have quite a lot of code which could be cleaned up if it were finished
<11> busy with like real stuff?
<5> real work, day job, all that.
<11> bummer :)
<12> is there a way to use lisp like TKLets,or Java-Applets?
<13> does anyone know if there is anything already written and free to parse various date formats and return ut's and vice versa?
<14> mc__: you could write a common lisp web browser plugin
<12> xarq,thats way too big for me
<15> Andrew: search cliki or cl-user.net for Date-Calc or net-telnet-date, for two possibilities
<15> Andrew: also, ISO8601-DATE
<13> ok, thx
<16> Hi all
<16> Anybody know if there is an audio book of Practical Common Lisp anywhere?
<17> Haven't heard of any
<16> Heh - I've been experimenting with the festival program - it's like hearing Stephen Hawking read it :-)
<17> Ahaha, I can imagine :)
<14> I can imagine having text-to-speech read PCL would get annoying when it reads the lisp code
<16> Yes, that would be trouble. Let me see...
<18> how can I run a system command (like say ls) and ***ign the result to a variable?
<16> Heh - yeah, that was useless.
<16> I wonder what feeding a usenet discussion into it would be like...
<19> drakeson - the answer depends on your CL.
<18> or where can I find a perl -> lisp (emacs-lisp/common-lisp/...) programmer-converter?
<19> drakeson - you can't.
<18> I mean just as a startup, to convert a perl programmer to a lisp programmer ;)
<19> try Practical Common Lisp , then.
<14> minion: tell Drakeson about pcl-book


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #lisp
or
Go to some related logs:

#suse
#perl
#suse
#php
#python
fedora4+fedora6
freejerk
xorg-x11 groupinstall fc5
#perl
bash script is directory



Home  |  disclaimer  |  contact  |  submit quotes