Wishlist for PureBasic v4.xx - Overview
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: Wishlist for PureBasic v4.0 - Overview
If you look at my post:
viewtopic.php?t=15479&highlight=freebasic
you will see another small list.
Anyway, to my small list the following should be added:
profiling
unicode strings (and all functions for it...)
with... end with (somewhere I read Fred is working on this)
classes (well not the whole sheebang like in real oop languages, but at least the following):
this would simplify the code, and make it more readdable.
I know there is didelphodon's precompiler and it seems to work great, but it's better if this functionality is inside the compiler.
BTW: IMHO all the other fancy OOP stuff is actually not needed because it overcomplicates things too much. Also no need for "design by contract" etc.
viewtopic.php?t=15479&highlight=freebasic
you will see another small list.
Anyway, to my small list the following should be added:
profiling
unicode strings (and all functions for it...)
with... end with (somewhere I read Fred is working on this)
classes (well not the whole sheebang like in real oop languages, but at least the following):
Code: Select all
; build some classes...
Class MyClass1
attribute1.l ;properties should always be private, access only inside the class
Method setAttribute1(value.l)
*this\attribute1 = value ; \ for accessing properties, like normal structures
EndMethod
Method.l getAttribute1()
MethodReturn *this\attribute1
EndMethod
EndClass
Class MyClass2 Extends MyClass1
attribute2.l
Method setAttribute2(value.l)
*this\attribute2 = value
EndMethod
Method.l getAttribute2()
MethodReturn *this\attribute2
EndMethod
EndClass
; here starts the main code...
NewObject *obj.MyClass2
*obj->setAttribute1(1) ; -> for accessing methods
*obj->setAttribute2(2)
Debug Str(*obj->getAttribute1()) + " / " + Str(*obj->getAttribute2())
*obj->destruct() ; actually the destructor could be called automatically when app ends
End
I know there is didelphodon's precompiler and it seems to work great, but it's better if this functionality is inside the compiler.
BTW: IMHO all the other fancy OOP stuff is actually not needed because it overcomplicates things too much. Also no need for "design by contract" etc.
Re: Wishlist for PureBasic v4.0 - Overview
Code: Select all
var.b ; 8 bits int
var.w ; 16 bits int
var.l ; 32 bits int
var.q ; 64 bits int
var.ub ; 8 bits unsigned int
var.uw ; 16 bits unsigned int
var.ul ; 32 bits unsigned int
var.uq ; 64 bits unsigned int
var.f ; 32 bits float
var.d ; 64 bits float
var.ld ; 80 bit float (long double) <--- for the huge scientific applications ;)
var.s ; ansi string / character (maybe var.c !?)
var.u ; unicode string / character
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
fsw, and Didelphodon,
no needed new words.
NewObject, Method and EndMethod is a surplus commands to do the stuff.
Objects are datatypes indeed. It is matter of the programmer to know and define what is a 'only data' structure and 'data & code' structure.
'Class' is Structure, and 'EndClass' is EndStructure. That's how i would do it at the moment if i was Fred.
no needed new words.
NewObject, Method and EndMethod is a surplus commands to do the stuff.
Objects are datatypes indeed. It is matter of the programmer to know and define what is a 'only data' structure and 'data & code' structure.
'Class' is Structure, and 'EndClass' is EndStructure. That's how i would do it at the moment if i was Fred.

Code: Select all
; build some classes...
Structure MyClass1
attribute1.l ;properties should always be private, access only inside the class
Procedure setAttribute1(value.l)
*this\attribute1 = value ; \ for accessing properties, like normal structures
EndProcedure
Procedure.l getAttribute1()
ProcedureReturn *this\attribute1
EndProcedure
EndStructure
Structure MyClass2 Extends MyClass1
attribute2.l
Procedure setAttribute2(value.l)
*this\attribute2 = value
EndProcedure
Procedure.l getAttribute2()
ProcedureReturn *this\attribute2
EndProcedure
EndStructure
; here starts the main code...
obj.MyClass2
obj\setAttribute1(1) ; -> for accessing methods
obj\setAttribute2(2)
Debug Str(obj\getAttribute1()) + " / " + Str(obj\getAttribute2())
End
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
This was already promised to be in version 4.0, via recent interview. Look at the interview thread found @ viewtopic.php?t=17324&highlight=interview and my reply. There is to be crossplatform compiling in 4.0. As stated in the interview, it's already there ... but unfortunately, it's not enabled for us users yet.DarkDragon wrote:Crosscompiling: Compiling Linux executables on Windows(so I just need to run my emulator when I wanna try it out).
When 4.0 will have most libriaries thread safe one (String doesn't count^^) Would be the coolest to be Thread safe, that is network it would be ideal to be able to listen with one thread per connection maybe something like thsi
Maybe there are better ways to do it but you get the point. It also would
allow the old system but with the ability to Thread like in other languages.
Code: Select all
Procedure MyListener(ConnectionId.l)
Protected End.l
Repeat
Select Dataavailable(ConnectionID.l)
Case 2
;Receive it
Case 0
delay(1)
Case 4
End.l=1
;Kill this Thread
Endselect
Until End.l=1
Endprocedure
InitNetwork()
Id.l=StartServer(#PB_Any,Port.l)
NetEvent.l=NetworkServerEvent(Id.l) ; We want to be able to use more than one server a time
Select NetEvent.l
Case 0
Delay(1)
Case 1
Creathread(MyListener(),NetworkclientID()
EndSelect
allow the old system but with the ability to Thread like in other languages.
Visit www.sceneproject.org
Re: Wishlist for PureBasic v4.0 - Overview
akee wrote:Code: Select all
var.b ; 8 bits int var.w ; 16 bits int var.l ; 32 bits int var.q ; 64 bits int var.ub ; 8 bits unsigned int var.uw ; 16 bits unsigned int var.ul ; 32 bits unsigned int var.uq ; 64 bits unsigned int var.f ; 32 bits float var.d ; 64 bits float var.ld ; 80 bit float (long double) <--- for the huge scientific applications ;) var.s ; ansi string / character (maybe var.c !?) var.u ; unicode string / character

Tranquil
What do you think about descripted idea for next version (maybe for v4 too!?) Would be very nice...
A command for using any kind of ColorFilters (R,G,B,A) for any 2D / 3D Sprites...!!! having only one original colored sprite and change its R,G,B,A values and display it in this colors... so you can draw one sprite object in different colors x times at once to the screen!
Code: Select all
OpenScreen(lWidth, lHeight, lDepth, cTitle$, [#Flags])
Possible Flags:
#PB_DoubleBuffering
#PB_TribleBuffering
#PB_AlphaBlending
#PB_CopyBuffer
#PB_AntiAliasing
#PB_AntiAliasing2
#PB_AntiAliasing3
#PB_AntiAliasing4
#PB_Software
Code: Select all
SpriteColorFilter(#Sprite,RGBA($00,$00,$FF,$FF)) ; for example... This would be very very helpfull for a lot of cheating stuff...
Last edited by va!n on Tue Nov 22, 2005 7:42 pm, edited 1 time in total.
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,