@# 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



Comments:

<0> hm, did I just leave?
<1> and join again
<0> odd
<2> I've got a function that creates a lexical variable (with 'let') and then p***es it to another function. In that other function i push an item into the list. I would have thought the list was p***ed by "reference" automatically. Is there something funky going on here that I'm missing?
<2> the list doesn't appear to be modified after the function call
<3> The "something funky" is the list being p***ed by value.
<0> no, pushing onto a list modifies only the variable it is bound to
<4> lisp doesn't have p*** by reference
<2> really?!
<2> woah
<4> really...
<3> Really. Something about Lisp not being VB.
<4> ok, keanu.
<2> so if i have a cl*** instance, and p*** it to a function, a copy is being p***ed?!
<0> if you add an element past the beginning, it will modify the actual list structure
<0> no



<4> illumina: no, the value is being p***ed
<4> the value of the object.
<0> illumina: the list in both functions is the same object, but not the same variable.
<0> so if you have another cons pointing to that list, it doesn't make that cons point to the list in every other function.
<2> ok
<2> i was ***uming some sort of under-the-hood similarty with C++ semantics...
<2> but I guess the terminology is really different. weird
<4> no, the terminology is identical
<2> ok so how do I get "p***-by-reference" behavior for a list?
<4> C++ was based on lisp, partly
<4> illumina: you don't.
<4> illumina: and lists have nothing to do with it.
<2> ok i'll rephrase my question again
<4> illumina: p***-by-reference has to do with the way parameters are p***ed, not the objects being p***ed.
<2> how do I create a variable in one function, p*** it to another function, and have its value modified so I can see that modification in the calling function
<2> ?
<4> (setf list (reverse list))
<2> so I have to return the list from the function?
<4> or use a modify-macro, maybe using define-modify-macro to create one first.
<4> illumina: I already said. lisp does not p*** by reference.
<2> in other words there is no obviously similar "out" parameter functionality in lisp?
<2> ok
<2> that's weird, but I guess that's why multiple-return-values are built in
<2> ok thanks :)
<4> exactly
<4> no need for out parameters
<5> oh there is such functionality (:
<5> but you can return multiple values from functions (:
<5> so why use that
<4> well, you can fake it and get some ugly code that looks like pascal or vb or c++
<5> indeed
<5> but really, why bother (:
<6> Job security.
<6> If Lisp isn't enough, write C++ in Lisp.
<5> haha
<6> If that still doesn't cut it: reader macros.
<5> ask mgr about job security one day (:
<5> (first (car (rest (car database))))
<6> Wonderful!
<7> you know, I think (caadar database) is actually more readable than that
<3> Job Security is all about being too valuable to fire. The problem with doing that by writing incomprehensible code is that at some point your employers will hire someone capable of translating and maintaining your mess, and then you're no longer quite so valuable...
<6> Yeah, you can just pretend that "caadar" is just some obscurely mnemonically named accessor function.
<8> Better yet: (defun database-${attribute} (db) (caadar db))
<8> or (defalias database-${attribute} caadar)
<3> ... The lispbuilder wiki seems to believe that there's a 23-bit version of windows out there...
<6> It runs in the "surreal mode" of the 80386.
<3> I thought that was 32-bit real-mode with paging?
<3> (Which, ah, apparently -can- be done.)
<9> it's called "unreal mode"
<6> Will LispOS run in that mode? :)
<9> and yes, it's a bizarre mode on the x86 where it runs in 16 bit with access to the full 4GB memory space
<9> not directly, but through paging
<3> a-priori_: No, no... Unreal mode is just kicking out the segment limits on the DS, ES, FS, and GS registers.
<9> so you're talking about something different?
<3> I'm talking full 32-bit instruction decoding by default, page translation, the works, but without segment descriptors and whatnot.
<9> well in that case, just use a flat memory model
<3> (And unreal mode can't do paging. Turning off the PE bit turns off the paging enable as well.)
<3> Look, we're not talking how to design an OS here, we're talking what you can persuade the CPU to do.
<9> okay, but that's how you'd do it
<3> No, because a flat real-mode memory model is too small.



<3> And a flat protected-mode memory model kills you in other ways.
<9> how?
<9> and why does this have to run in real mode?
<10> drei-lisp-syntax:circle-subst is mad!
<6> I agree.
<6> Is it buggy, or are you just taking the tour of the haunted house?
<10> I'm not sure what it's trying to do, but it has descended from a drei::accept-result, through several presentations, to the pane, the event queue, the clx port, two hash table or two, an indexed pattern, finally complaining that the pixel array for the pattern is not a sequence.
<6> Awesome!
<10> if I patched a default case in, I wonder how much of the lisp image it would eventually touch
<6> What type is the pixel array?
<6> I copied the function almost verbatim from SBCL.
<6> Of course, I suddenly realise that it dies horribly on multidimensional arrays.
<10> some kind of two dimensional array
<6> Hm, what is the canonical way for iterating through the elements of a multidimensional array?
<4> in what order?
<6> Irrelevant in this case.
<4> you could use row-major-aref
<10> just to rewind briefly, why is it traversing these seemingly unrelated objects?
<4> or a displaced array. or in sbcl or cmucl, use with-array-data
<6> hefner: for handling the label reader macro.
<6> Label references are replaced by placeholder objects which are then replaced by the real objects using a call to `circle-subst'.
<6> rahul: thanks.
<10> Well, sounds brain damaged to me. There's no way any of that stuff is getting printed.
<6> I just took it from SBCL and modified it to fit.
<10> I can't seem to reproduce it, now =/
<6> (let ((*sharp-equal-circle-table* (make-hash-table))) (circle-subst nil (make-array nil)))
<10> A moment ago I tried writing a Debug Presentation command, accepting a debugged-presentation type which wrapped up the original presentation, and a translator from t to debugged-presentation
<10> oddly, the translator is applied twice, giving me a debugged-presentation containing a debugged-presentation containing the presentation I clicked
<5> hefner: are you using the correct argument names on the translator?
<5> i.e. OBJECT, not PRESENTATION?
<5> or the other way around?
<5> argh!
<6> Those naming rules are a whole different cl*** of joy...
<5> hefner: it seems to me that you don't need that translator
<5> because the nesting behavior is pretty much correct
<5> (***uming your command takes a debugged-presentation argument)
<10> I don't follow - I want to be able to click on an arbitrary presentation, and there's no way I know of to get the presentation rather than the presented object as a command argument
<5> hm.
<10> so I guess the translator runs once when I click the object, and then is applied a second time to the structure object that was inserted into the command line
<6> That shouldn't happen - what's in the input-buffer shouldn't require further translation.
<5> hefner: hm, what does the translator look like?
<5> (just to be sure) (:
<10> it translates from t to my type, takes the object and presentation args, and makes a structure containing them. :)
<3> Gah. -Why- must all of the open source paint software **** horribly?
<5> I was interested in the code, but I get the picture, thanks (:
<5> nyef: what, even the clim paint thing? (:
<4> nyef: because otherwise the open sores would be visible. and no one wants to see that!
<5> nyef: anyway, http://canvaspaint.org/ "ftw", as they say on the internets (:
<3> antifuchs: What, no layer transparency?
<5> it's just a pixel-perfect clone of non-open-source ms paint (:
<10> I can't imagine anyone unsatisfied with GIMP but wanting powerful features being any more tolerant of any other paint software I've ever used
<5> DWIM paint (:
<5> "face here:
<3> hefner: The GIMP would be tolerable if the input system weren't completely broken.
<10> (Photoshop being particularly intolerable, since they just add new layer effect gimmicks and move stuff around and in and out of toolbars instead of making any real improvements)
<10> I will argue that for a long time GIMP was much less broken than photoshop, because the @#*#(*!@&#*(!@ color selector in photoshop used to be modal
<10> which is so shockingly stupid that photoshop should've never been allowed to live
<3> (I mean, really, why the disconnect between where my mouse cursor is and where painting happens? And why does right-clicking put it into some weird scroll-when-the-mouse-moves mode?)
<10> hmm, I've never noticed either of these things. Maybe I use an old version. =p
<3> It could just be because I use a tablet.
<10> I've used a tablet with gimp before in the distant past, it worked fine.
<3> Okay, it could be because I use a tablet on Win32.
<10> oh, well, you should just be grateful anyone bothered porting it to your third-world operating system, then.
<3> I'm sure. After all, a broken port is of use to -so- many people.
<4> people acutally use the gimp on win32?
<5> sure
<5> I used to paint crappy icons with it
<4> I find that pbrush.exe suffices for crappy things
<3> I don't: It doesn't work worth a damn due to the input handling being completely broken.
<3> Leaving me with the option of using MS Paint.
<5> rahul: they needed to be /sophisticated/ crappy icons
<5> (for when ripping off the stock kde ones wasn't good enough)


Name:

Comments:

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






Return to #lisp
or
Go to some related logs:

unlock database linux command install adept
#centos
#css
#web
permission denied while setting flags
#linux
ati radeon r200 drivers
stoping xserver
could not run su debian
#gentoo



Home  |  disclaimer  |  contact  |  submit quotes