//flex table opened by JP

Click to See Complete Forum and Search --> : Oberon-2 (derived from pascal)


Paco103
12-05-2003, 12:52 AM
Ok - another obscure language for me:)

Anyway - I'm trying to write a turing machine emulator in Oberon-2. So far I really don't like the language. It seems to be very static. All I need is a dynamic ARRAY of strings (which in this language is a dynamic 2D array of characters). The problem is, the language won't let me build an array unless I know it's size AT compile time, and I won't know it until run time. My options are to make an insanely huge 2d array, or to make a dynamic array. I don't need to be resizing during runtime, when I need a new size it's because I'll need all new data, so I'll just build a new one. This stupid language won't allow variables for size declerations though. ONLY strict hard coded numbers are allowed.

Anyone that has any ideas or reference resources, knows anything about Oberon or Pascal, or is just a programming genius - your help would be appreciated. Unfortunately this is due next week (and no it's not from me putting it off, we only had about 2).

ScaryBinary
12-06-2003, 12:41 AM
Hmmm....if you look at section 2.3 in the link below, it seems like maybe dynamic arrays are supported.

Comparison of C++, Oberon-2 (http://www.arithmetica.ch/Oberon/CFORTRANOberon.nhtml)

A little more reseach reveals that you can have dynamic arrays, but only in certain cases (see Section 6.2 and the referenced sections).

Oberon-2 Reference (http://www-vs.informatik.uni-ulm.de/projekte/Oberon-2.Report/Chapter06.html)

Hope some of this helps or gives you a new idea. Looks like some interesting stuff. I had two years of Pascal in highschool, but I don't remember anything about it now!

Paco103
12-06-2003, 02:36 AM
Thanks for the help. I'd actually already found those sources, and I spent a long time trying the Dynamic arrays, but those are only useful in method calls to allow flexible parameters. I have made it around the limitation, actually just about 2 hours ago. I built a Stack structure from scratch (with some help from a library book). Now that I've figured out how to set the file types with records, I'm on to build a Linked List all by my wee little self :D

Thanks again!