| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> they're a hint to the compiler, and that's all <1> heh. but that's not what people expect when you say "yes, you CAN do static typing" <0> obelus: "strict" heh :) yes <2> obelus: sort of <3> why only sort of? <2> obelus: because that description misses the point. <0> if it's strictly dynamic, declared as T, then it can be 4 one point and "foo" the next. <3> rahul: yes, that's what i'm saying/asking <0> but it doesn't just apply to ***ignment <3> beach, what point am i missing? <0> it applies to function calls, as well <3> rahul: understood <0> (f 4) (f "foo") <0> effectively, that's a broad form of polymorphism <2> obelus: the point that the ability to do so radically alters the way you develop your software.
<0> generic-functions add the ability to dispatch to independently defined functions based on the types <3> beach, no, i understand that <0> let's say you have a function that computes the badness of a line break pattern (as in TeX) <3> ok, what does the statement "There are no type definitions in the language" mean? Merely that I don't have to say 'int a = 4'? <0> you'd have a function, badness+. (defun badness+ (x y) (+ x y)) <2> obelus: probably that when you declare a variable, you don't mention any type. <3> ok that's what i thought <0> and later you realize, there are some things we need to REALLY forbid, like text running off the end of the page. we need a badness value for "infinitely bad". <3> and finally, "each value carries its own type" ... is that not self-evident? <0> let's use T. (defun badness+ (x y) (if (or (eq t x) (eq t y)) t (+ x y)) <3> rahul ... while i appreciate your effort, i can't code or read lisp <0> done. no need to recompile anything else, just continue along and set badnesses to T where you should. <3> so if it's for me, it's wasted <3> =) <2> obelus: sure, but they probably mean that you can query that type at runtime, like: if ... then a = 2 else a = "hello"; print(typeof(a)); <3> ok, i think i've just been trying to overanalyze <4> beach: C++ also has that sort of information at runtime (for some types), though. <2> pkhuong: sure. I was just helping obelus interpret "each value carries its own type" <3> ok, thanks for help, all <2> anytime <5> I want to run unix command like "find", "grep", etc in SBCL, and return the result as string or a list of strings. How to do that? <6> run-program <0> pebblestone: you can also do some of that kind of stuff from within sbcl <0> for grep, see cl-ppcre <5> rahul: I need to batch some command, not only grep and find. <5> I entered: (sb-ext:run-program "ls" '()) bt sbcl reports "no such program: ls" <0> don't think it searches $PATH <5> rahul: I don't get it. Can you elaborate? <6> pebblestone: (with-output-to-string (foo) (run-program "/bin/ls" nil :output foo)) <6> or <5> ah, isee <5> yup? <6> pebblestone: (run-program "ls" nil :search t ...) <5> yain: thanks. <6> do you know what $PATH is? <5> i know. environment var <6> you shell uses it find programs when you type their names. <5> hehe, thank you. forget about my last question. it's stupid <7> is there a way to usleep in sbcl? <6> I don't think there is an existing binding for it you can use FFI though. <6> actually, just SLEEP should work. <6> in SBCL it accepts fractions. <8> Hehe, my Emacs code-walker works; LET-bound variables are highlighted through the LET bodies. <0> scary <5> quotemstr: do you any screenshots? <5> quotemstr: have <8> I will, once I rewrite it to update the goddamn fontification properly. <9> morning <10> morning splittist <11> morning indeed <9> What's new and exciting? <10> CLEM is finally starting to get the long-overdue cleanup, including multi-dimensional matrix support <10> and maybe, if I'm lucky, some documentation and more test coverage <7> hello <1> hi <7> *phew* <7> fixed a really stupid error :| <7> didnt realise that if n was 0, incf n would return 1 <7> took a while to track down though <12> (incf n) is ++n, (shiftf n (1+ n)) is the equivalent
<12> of n++ <7> :o <7> I didnt even know of shiftf <7> oh thats interesting, thank you <12> shiftf is quite nice, because you can do (shiftf a b c 1) <0> rotatef, too <12> also, (rotatef a b) ... yes <7> (shiftf a b c 1), sets a to b, b to c, and c to 1 ? <0> yes <7> so would (rotatef a b c 1) cause an error? <1> yes <1> because you can't ***ign 1. <7> is there equivalent bit-based functions like shiftf and rotatef ? <1> there is ash. <1> if i understand you correctly. <1> but no rotate <7> oh yeah ash is like shiftf <1> well, really ash is an arithmetic shift. <1> on an integer of unlimited size. <1> maybe you're really talking about something else <7> im just wondering about whats easy to do with bits <1> bit field extraction and insertion is easy. <7> maybe change my bit io functions.. <1> ldb, (setf ldb), dpb, mask-field, (setf mask-field), deposit-field <0> clhs logior <13> http://www.lispworks.com/reference/HyperSpec/Body/f_logand.htm <1> there are a confusing profusion of functions. <0> logcount, logbitp <0> logtest <1> but the basic idea is, that ldb lets you pull a bitfield out of an integer, and (setf ldb) or dpb let you put one in. <7> oh that is pretty cool <1> and mask-field, (setf mask-field), and deposit-field do exactly the same things, but they leave the bitfield in the same position. <7> there is a lot of symmetry for things like that, which you just dont get in other languages <7> can you write code for your own setf type function with defgeneric? <7> (im just guessing at defgeneric) <0> you can <0> clhs get-setf-expansion <13> http://www.lispworks.com/reference/HyperSpec/Body/f_get_se.htm <7> woah <0> </keanu> <7> I wrote a little huffman compressor <7> Id done it before in C++ <7> but in C++ its 400 lines <7> and im only a beginner in lisp but its 187 lines <7> (C++ count doesnt include headerS) <7> and keanu sais more than woah! :p <9> dude! <7> haha <0> haha <0> but the only line he really gets right is whoa <1> radical! <0> nah <0> dude is probably the limit <1> i really liked this reviewer's translation of Through a Scanner Darkly: "The technique of rotoscoping may not be suitable for all movie genres. Fortunately, Keanu is nothing if not a cartoon." <14> http://www.stanford.edu/cl***/cs242/readings/backus.pdf <- Interesting read, albeit quite dated <6> what's that? <14> yain: About why "cl***ical" programming languages **** :) <6> considered harmful considered harmful? <14> His sollution sound rather LISPish <14> Harmful? <14> > Now suppose a language had a small framework which could accommodate a great variety of powerful features entirely as changeable parts. Then such a frame- work could support many different features and styles without being changed itself. In contrast to this pleasant possibility, von Neumann languages always seem to have an immense framework and very limited changeable parts.< <6> oh, that. <14> A quote from the article <14> Very true of what I've seen of common lisp ti <14> this* far <14> Coming from C++ :P <14> C-like languages really still are more about describing to the computer how to do things instead of generaly describing what is to be done. <6> this depends on what you mean by C-like languages, but no, not really. <6> most modern languages with C-like syntax, have very little common with C. <15> I would say that C is essentially a byte sequence processing language <15> http://damienkatz.net/2007/01/the_volkswagen.html <- cute <14> yain: By C-like languages I mean mainly C and C++ as those are the one I know. I know some Java and C# where the main difference is better OOP which is essentialy trying to patch this deficiency by hiding it <14> Zhivago: haha :D
Return to
#lisp or Go to some related
logs:
#sendmail ubuntu mousepad too sensitive datetme mysql #css #php #gentoo #oe #ubuntu #linux gentoo pppoe-start timed out
|
|