Author Topic: How to implement C# like properties and indexers  (Read 2933 times)

0 Members and 1 Guest are viewing this topic.

kryton9

  • Guest
How to implement C# like properties and indexers
« on: May 29, 2012, 09:56:15 AM »
Charles, I thought you might find this interesting and a possible way to add this sort of thing into OOPOxygen.
http://www.codeproject.com/Articles/33293/C-implementation-of-the-C-Property-and-Indexer-wit

Charles Pegge

  • Guest
Re: How to implement C# like properties and indexers
« Reply #1 on: May 29, 2012, 12:05:01 PM »

Hi Kent,

That's what I would call abstract programming, and I'm afraid most of it went over my head. I think a real-world example or two would help to clarify the significance of these constructs.

OOP becomes really useful when dealing with multiple interacting objects, like the controls and dialogs of a windows application, or the behaviour of multiple entities in a game.

Have you seen the population demos?  projects/population/

Charles

kryton9

  • Guest
Re: How to implement C# like properties and indexers
« Reply #2 on: May 29, 2012, 02:28:55 PM »
I just thought you might like reading about it. I don't think it is anything that needs to be added to oxygen.

I have been looking at a lot of the new examples, very nice ones in there. I am rewriting my classes for the game development kit and so I have been studying all the new things in the examples.

I hope soon to setup a development section on my website for it. I will leave the core inc files as you have them, but everything else I will redo in my style and the style I would like to use for the game engine.
It looks like oxygen is developed and stable enough to start coding whole heartily in it.

There are no major foundational changes coming, is this safe to assume? Just bug fixes and optimizations?


Charles Pegge

  • Guest
Re: How to implement C# like properties and indexers
« Reply #3 on: May 29, 2012, 03:20:05 PM »
It's mostly bug fixes, and feature fill-ins. Your programs are an important part of my test suite, Kent  :). We all have different coding styles, and the consequences of introducing a new language rule are hard to anticipate. So testing against a wide variety of programs is essential.

I am still pulling the occasional dead feature. For instance, I've removed the proc keyword. Call does the same job. Iam also planning to remove arrow notation.-> since it does not fit Oxygen's semantic model, and it will be a source of confusion if I leave it in.

Charles


kryton9

  • Guest
Re: How to implement C# like properties and indexers
« Reply #4 on: May 29, 2012, 06:15:37 PM »
Those all sound good to me Charles. What about this notation, I assume this stays?
COORD keyWhere
keyWhere  => ( 15, 0 )

Also wanted to note that the error system has gotten much better. All of my errors tonight in rewriting the code, I have been able to figure out with the error messages.
So your behind the scene work is much appreciated.
« Last Edit: May 29, 2012, 08:54:29 PM by kryton9 »

Charles Pegge

  • Guest
Re: How to implement C# like properties and indexers
« Reply #5 on: May 29, 2012, 08:56:31 PM »

Yes, and there is also a C-like alternative now: (works with curly braces)

sys a[5]={1,2,3,4,5}

kryton9

  • Guest
Re: How to implement C# like properties and indexers
« Reply #6 on: May 30, 2012, 08:25:30 AM »
I like both choices. For short arrays, the => syntax is really nice and for large datasets the c style is nice. Once I get a few more things converted over, I am going to test using sqllite3 for complex containers, like linked lists, maps etc. Then we can do benchmark tests comparing it with your BString method which I couldn't really understand. Anyways, we can discuss that when the time comes and the benchmarks are ready.