POV-Ray : Newsgroups : povray.general : 4.0 Feature discussion : Re: 4.0 Feature discussion Server Time
9 Aug 2024 01:27:22 EDT (-0400)
  Re: 4.0 Feature discussion  
From: Alessandro Coppo
Date: 7 Sep 2000 16:11:03
Message: <39b7f657$1@news.povray.org>
I would really like that POV-4 had associative arrays of heterogeneous
elements. For example:

arr["location"] = <1,1,1>;
arr["texture"] = texture { ... }
arr["show"] = true;

etc.

Why?

Well, with this kind of containers it would be possible to fake object
oriented programming. For example

#macro MySmartBox_Create(this)
    this = assoc_array();
    this["location"] = 0;
    this["side"] = 1;
#end

#macro MySmartBox_Display(this)
    object {
        this["location"] - <Side/2, Side/2, Side2>,
        this["location"] + <Side/2, Side/2, Side2>
        texture {
            this["texture"]
        }
    }
#end

etc.

Having associative heterogeneous arrays + macros is all that is needed for
OOP in POVRay.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.