|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
http://en.wikipedia.org/wiki/Abstract_data_type
http://en.wikipedia.org/wiki/Algebraic_data_type
ADT is abstract data type, which is *not* "an opaque object" in the
object-oriented programming sense.
"Algebraic Data Type" is not the abstract version of "a class" either.
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 22/10/2010 02:56 AM, Darren New wrote:
> http://en.wikipedia.org/wiki/Abstract_data_type
>
> http://en.wikipedia.org/wiki/Algebraic_data_type
>
> ADT is abstract data type, which is *not* "an opaque object" in the
> object-oriented programming sense.
>
> "Algebraic Data Type" is not the abstract version of "a class" either.
In other words, abstract data type /= algebraic data type, just like
I've been saying all along. :-P
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> In other words, abstract data type /= algebraic data type, just like
> I've been saying all along. :-P
Yes, but I didn't say it was. I referred to "abstract data type" and many
people said "You mean a class declaration without the implementation?"
I.e., bunches of people don't know the difference between "abstract data
type" and "abstract class". And then I think *you* told me "no, an abstract
data type is a class without implementations, and an algebraic data type is
what you think you're calling an abstract data type."
Clearly I misunderstood what you were telling me.
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New escreveu:
> http://en.wikipedia.org/wiki/Abstract_data_type
>
> ADT is abstract data type, which is *not* "an opaque object" in the
> object-oriented programming sense.
it's opaque if you don't mess with it directly. It was the old
procedural way of doing OO-like programming in languages with not enough
encapsulation abstraction.
It reminds me of a great Larry Wall quote (Perl's creator is full of
priceless quotes):
"In Perl culture, for instance, you're expected to stay out of someone's
home because you weren't invited in, not because there are bars on the
windows."
source: http://tinyurl.com/34kjkcb
He was talking about packages/modules encapsulation though.
--
a game sig: http://tinyurl.com/d3rxz9
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New <dne### [at] sanrrcom> wrote:
> I.e., bunches of people don't know the difference between "abstract data
> type" and "abstract class". And then I think *you* told me "no, an abstract
> data type is a class without implementations, and an algebraic data type is
> what you think you're calling an abstract data type."
I don't know what "abstract class" means in other languages, but at least
in C++ it means a class that cannot be directly instantiated (the only way
to use it is to inherit from it). In other words, a bit like an interface
(but with the possibility of having member variables and function
implementations).
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> I don't know what "abstract class" means in other languages,
That's pretty standard terminology, yes.
I see that over the last couple of years, Google has pushed the correct
definition of "abstract data type" up to the top, which is good.
Example incorrect definitions:
http://www.desy.de/gna/html/cc/Tutorial/node4.html
http://www.pcmag.com/encyclopedia_term/0,2542,t=abstract+data+type&i=37349,00.asp
http://www.allinterview.com/showanswers/10639.html
It used to be the top two or three pages of google hits were all pointing to
notes in university lectures that basically confused "abstract data type"
with "object-oriented data abstraction".
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
nemesis wrote:
> Darren New escreveu:
>> http://en.wikipedia.org/wiki/Abstract_data_type
>>
>> ADT is abstract data type, which is *not* "an opaque object" in the
>> object-oriented programming sense.
>
> it's opaque if you don't mess with it directly.
Yes, but it's not an ADT just because it's opaque. That's what lots of
people thought the definition of ADT was a couple years ago. Good to see the
right answer is picking up.
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I.e., bunches of people don't know the difference between "abstract data
> type" and "abstract class". And then I think *you* told me "no, an
> abstract data type is a class without implementations, and an algebraic
> data type is what you think you're calling an abstract data type."
>
> Clearly I misunderstood what you were telling me.
I'd be rather surprised if that's what I said, given that I have no clue
what the hell an abstract data type actually is.
(I remember the Eiffel book mentions them. And I remember the concept
not making much sense...)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v8 wrote:
> I'd be rather surprised if that's what I said, given that I have no clue
> what the hell an abstract data type actually is.
As I said, I obviously misremembered, because looking at the definition of
algebraic data type, you obviously wouldn't confuse those two.
An ADT is a type whose operations are defined algebraically. So instead of
saying "Push adds a value to the stack. Top tells you what's on top. Etc"
you say something like
For all X, push(X, empty) does not equal Empty.
For all X and all S, top(push(X,S))==X
For all X and all S, pop(push(X,S))==S
(And of course you add the type signatues just like in Haskell)
It says absolutely nothing about what you have to do to implement it. Yet
you can prove you've specified every possible combination.
Peano arithmetic is a sort of abstract data type for the integers.
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |