Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

You know what?

Name: Anonymous 2009-02-26 16:36

Pointers totally suck.

Name: Anonymous 2009-02-26 16:43

no u suck because u r too stupid too understand them

Name: Anonymous 2009-02-26 16:47

>>2
I understand them fine, but they suck because of how limiting they are

Name: Anonymous 2009-02-26 17:03

Hello, my name is Steve and I am an expert in the field of the Microsoft Visual C# 2008 .NET Express Edition Programming Language.

What ere pointers?

Name: Anonymous 2009-02-26 17:07

>>4
The tools of the devil. He baits you with some semblance of functionality that things that aren't pointers lack, and then when you start using them, you stir up all kinds of shit and have to code your way around their totally sucky behaviour.

Name: Anonymous 2009-02-26 17:10

Name: Anonymous 2009-02-26 17:50

>>3
ur brain is totally limited dude

Name: Anonymous 2009-02-26 17:52

Limiting in what way? It's just how you access random memory? It's nothing more than a memory address. How would you access memory otherwise without an address? Would you do it by tags? You'd need offsets in those tags, and there you get pointers again. Stop being so stuck up about it and realize that this is how machines really work.

Name: Anonymous 2009-02-26 17:55

>>1
I don't understand why you say that.

Name: Anonymous 2009-02-26 17:57

>>8
Not all machines.
Also cdr totally kicks your pointers' asses.

Name: Anonymous 2009-02-26 18:16

>>10
OH AND IS THAT IMPLEMENTED WITH THE CDR MACHINE CODE INSTRUCTION???

Name: Anonymous 2009-02-26 18:39

Name: Anonymous 2009-02-26 20:52

>>12
Pardon me but I believe those machines had memory.

Name: Anonymous 2009-02-26 22:16

>>13
Which is manipulated with cons, car, and cdr.

Name: Anonymous 2009-02-26 22:50

>>14
So how would you go about implementing something as simple as the C equivalent of:
int a[256];
a[97] = 31009;

I have a rudimentary idea, but it seems 1)slow 2)uses too much memory to store the array.

Name: Anonymous 2009-02-26 23:10

I FUQUIN LOVE POINTERS!!!!
and KOREA

Name: Anonymous 2009-02-27 0:10

>>15
Depending on the dialect,
(defvar a (make-array 256))
(setf (aref a 97) 31009)


That's Common Lisp. Earlier dialects may vary (especially with respect to including SETF), but later-period Lisp machines would be like that. Lisp just doesn't represent arrays as a pointer to a block of memory, although obviously they are stored that way in memory, plus a bit of metadata like their size, and perhaps the type of data in them (for optimization purposes, not for static typing).

Name: Anonymous 2009-02-27 0:27

>>15
Read SICP, you heathen.

Name: Anonymous 2009-02-27 1:54

>>17
Yea, I'm aware of the existence of those instructions, but in >>14's example, it led me to believe that his machine didn't have any pointer support whatsoever , nor did it have array, reference support, and you were only allowed to use cons, car and cdr.

>>18
I haven't read my SICP today, but I did read a good part of SICP a while ago. I don't see how you can avoid having plenty of overhead for storing arrays(basically what would be stored as a simple continous buffer in memory when using C-like languages) if you're only limited to cons/car/cdr and a native type such as an integer (or the type of data you're putting in an array). Yes, it's enough to implement any data structure, but for an array of n elements, you need n pointers to store them in a system only supporting cons for allocating/storing data, since each cons will have 2 pointers to your allocated data, so for n elements you'll need n pointers.

Example 1:

  (cons 1 (cons 2 (cons 3 null)))
 /  \
1   (cons 2 (cons 3 null))
   / \
  2  (cons 3 null) ; null doesn't point anywhere
     /
    3 

So you have 3 elements up there, and you need 3 cons's to store them, each containing 2 pointers, so you need a total of 6 pointers to store this array. In an real arch such as x86, this would mean that to store 3 32-bit integers(12 bytes), you need 9 32-bit dwords ( 36 bytes ), or 3 times the amout you'd need if you would have used a pointer. Seems a bit inefficient to me, which is why you'd need specialized datatype for storing arrays.


Note that the actual arrangement of the tree itself won't change the needed amount of memory:
Example 2:

   (cons (cons 1 2) (cons 3 null))
                / \
               /   \
              /     \
        (cons 1 2)  (cons 3 null)
            / \     /
           1   2   3

(6+3 = 9 dwords needed again.)

Name: Anonymous 2009-02-27 2:25

>>19
I don't know what to tell you except that >>14 is a retard. I'm not sure when arrays first appeared in a Lisp, but one would think it was before 1960.

Name: Anonymous 2009-02-27 7:28

>>20
I don't know what to tell you except YHBTE

Name: Anonymous 2009-02-27 8:42

>>12
you just created that article

Name: Anonymous 2009-02-27 12:58

>>22
no, YOU just created that article

Name: Anonymous 2009-02-27 16:05

>>21
Rather, IHBTIndirectly

Don't change these.
Name: Email:
Entire Thread Thread List