top | item 17535483

(no title)

dumb22233 | 7 years ago

You could use XML data structures in which some of the elements are programs that you can execute (program is data), other are graphic, other are links to more XML data and so on. And your program is able to process that information.

discuss

order

Peaker|7 years ago

Then what you have is not "anything". You have an expression problem:

Either each element has some "handler" that does the right thing for that data type.

Or you have a set of cases that each data can be, and you handle them all.

Neither is just "any type". And static types are very suitable to describe either.

hderms|7 years ago

The handler being a typeclass in Haskell vs the enumerated cases being pattern matching?