Namespaces are halting me!

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Namespaces are halting me!

Post by Moonshine »

Ive been desperately trying to find various DLLs to work with PB but all use namespaces and so I cant really try to interface them. All I would like is if PB had support for namespaces (just when dealing with external DLLs) and I could probably get a multitude of them working. Why does the world have to be so.... C++? :wink:
Mark my words, when you least expect it, your uppance will come...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

what *are* namespaces?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

>actually, i've never been much in seven of nine

You wish :)

Well , not that pretty though..
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

>actually, i've never been much in seven of nine

You wish

Well , not that pretty though..
What the hell? :?
what *are* namespaces?
Namespaces are an OO feature of C++ and the like - they are a measure to prevent two libs clashing when both libs have a command with the same name. An example would be DLL1 and DLL2 - imagine these both had a command called GetString() or something like that. If you typed GetString() into your prog that was using both these libs, bad things would happen because it wouldnt know which DLL you were referring to. Therefore the DLL's use namespaces - in C++ it would look like DLL1::GetString() and DLL2::GetString(). this way it knows which you mean and problems are avoided.

Basically every DLL Ive found uses namespaces and without an equivalent in PB, they cant really be used. For example in the Irrlicht 3d engine it uses the namespaces irr::, irr::core, irr::gui, irr::io, irr::scene and irr:video whereby classes are contained within these namespaces.

Its only a small thing and I just thought PB might benefit from the compatibility.
Mark my words, when you least expect it, your uppance will come...
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

>What the hell?
Naah, heaven :)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

it's heaven of nine :-)

if it only would be seven of mine ;-)

oh darn, getting poetic on my age...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

oh darn, getting poetic on my age...
I have to say with much sadness, it be the first sign of madness!
ivory
User
User
Posts: 36
Joined: Fri Jun 25, 2004 2:30 am

Post by ivory »

As a work around, if you desperately need access to a library, I suppose someone could write a C++ wrapper to call the namespace functions and export non-namespace functions.

And if someone fluent in C++ provides that for you, I think MS provides C++ compilers free to download (I don't know if they are .net, or if namespaces requires .net). I imagine, with one program in hand, as a template, others would not be too difficult.
Post Reply