POV-Ray : Newsgroups : povray.general : Script language speed : Re: Script language speed Server Time
7 Aug 2024 13:22:23 EDT (-0400)
  Re: Script language speed  
From: Jon A  Cruz
Date: 7 Nov 2001 12:37:14
Message: <3BE9710A.59F6A388@geocities.com>
Redbeard wrote:

> Packages are used (I can't remember
> what language that is from...) as well as any number of different ways of
> distinguising variables from one set of files to another.

Java is one language that uses packages.

Their naming is to use a hierarchial tree of dot-separated names, and the standard
for choosing names is to start with reversed domain names. This latter way adds an
extra layer of safety against name collisions.

package org.xml.sax;
...
interface Parser {
...
}

Then in other code, one could use:

org.xml.sax.Parser thing = new org.apache.xerces.parsers.SAXParser();

or
import org.xml.sax.Parser;
import org.apache.xerces.parsers.SAXParser;
...
Parser thing = new SAXParser();

And here are the example docs I was just looking at:
http://xml.apache.org/xerces-j/apiDocs/overview-summary.html

Anyway, I find it more usefull than C++ namespaces where you have a single
top-level collection of naming shared by the entire world. Among other things, you
start to see names decorated with package naming like:

xmlSaxParser thing = new apacheXercesSAXParser();

And don't get the option of short-cutting.

--
Jon A. Cruz
http://www.geocities.com/joncruz/action.html


Post a reply to this message

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