Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Collection Class and Memory Manager
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ericfourfour




PostPosted: Wed Feb 07, 2007 4:50 pm   Post subject: Collection Class and Memory Manager

Collections, Vectors, Iterators, Memory Management... What more can I say?

freakman's string class has been integrated into this library (with some modifications, ie. naming conventions, optimizations) so strings can be created easily.

Check out test.t for a sample program.

Import Standard to reduce the amount of typing required when using this. Make sure your classes inherit Object.

I'm thinking of adding a LinkedList class and classes for each of Turing's built-in types.

Edit: I just realized this is in the wrong forum. Is there any chance it can be moved to Turing submissions.



Collection.zip
 Description:

Download
 Filename:  Collection.zip
 Filesize:  5.18 KB
 Downloaded:  130 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Wed Feb 07, 2007 7:16 pm   Post subject: RE:Collection Class and Memory Manager

This reminds me of the time I tried to get an elegant solution to the problem of making Turing dynamically typed. That is, make everything an object, and then we do typing by making everything an Object object. There's another project for you. Smile

Moved!
ericfourfour




PostPosted: Thu Feb 08, 2007 12:04 am   Post subject: Re: Collection Class and Memory Manager

I'm not sure I follow cervantes. Do you mean like ruby where (nearly) everything is an object? Or like Java where all classes extend Object? Or am I still off?

I do have to say, this would be a lot simpler (and more flexible) if Turing had static members, constructors, destructors, and a way to call a super implementation of a procedure.
Cervantes




PostPosted: Thu Feb 08, 2007 12:13 am   Post subject: RE:Collection Class and Memory Manager

I mean both. Ruby is dynamically typed, in that we don't have to specify what type our variables are. As I understand it, that's just an extension of the fact that everything in ruby is of type Object.

In Java, you can still use the primitives. int, char, boolean... Your implementation of this project in Turing would be like Java has it: we would still be able to access the primitives (of course we would--there's no way you could remove that from the language) but there will be classes for Integers and Arrays and the like. And they will all inherit from Object.

I forget the reason I never did this. Something was holding me back, but I can't remember what that was.
ericfourfour




PostPosted: Thu Feb 08, 2007 9:21 pm   Post subject: Re: Collection Class and Memory Manager

I am already working on integrating classes for the primitive types. I'll probably add a few more collections as well.

The main reason, I find, that makes this frustrating is it requires at least four lines to create every object (declare, allocate memory, add to memory manager, initialize values). I'm sure that when I get further into this project, I will find more limitations.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: