[fpc-pascal]Representing data

John Coppens john at johncoppens.com
Fri May 16 17:19:20 CEST 2003


Hello, Alan

This is normally done in a more rigid language like Pascal by object
oriented programming, and using polymorphism. You can then not only store
different types of values into an object, but also define the correct
actions that can be undertaken on each type.

Do a search on these terms, and you'll find plenty tutorials/texts on the
subject.

John

On Fri, 16 May 2003 08:05:20 -0700 (PDT)
Alan Mead <cubrewer at yahoo.com> wrote:

> Tell me if this is not an appropriate question for this list.
> 
> I was thrilled to find out how mature FPC had become (thanks!) and
> I'm using Pascal again.  But I find that I miss Perl's magical
> ability to handle different data types in scalars.  Can I create an
> "datum" object that can gracefully hold different types of data?
> 
> I ask because I need to represent numeric data in memory and analyze
> it.  The data will "look" like an Excel spreadsheet (and if I cannot
> fit it all in RAM I'll have to operate on it piece-meal).  The values
> will be strings, reals, bytes and often large numbers of binary
> values.  But one dataset might have one column of reals while another
> might have five columns of reals.  One dataset might be composed
> almost entirely of binary values while another is composed of mostly
> bytes.  How can I design code that handles any of these datatypes
> efficiently but without knowing in advance how much it will get? 
> Execution speed, BTW, is far down on my list of priorities after
> robustness, flexibility, platform independence, maintaintainability,
> etc.
> 
> Thanks!
> 
> -Alan Mead
> 
> 
> 
> =====
> A Congressman was once asked about his attitude toward whiskey.  "If you
> mean the demon drink that poisons the mind, pollutes the body,
> desecrates family life, and inflames sinners, then I'm against it. "
> 
> "But if you mean the elixir of Christmas cheer, the shield against
> winter chill, the taxable potion that puts needed funds into public
> coffers to comfort little crippled children, then I'm for it."
>  
> "This is my position, and I will not compromise."
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


--




More information about the fpc-pascal mailing list