|
|
Log in / Subscribe / Register

Overloaded types in Samba

Overloaded types in Samba

Posted May 21, 2007 15:34 UTC (Mon) by rfunk (subscriber, #4054)
In reply to: Critical Vulnerabilities in Samba by ms
Parent article: Critical Vulnerabilities in Samba

Isn't "Maybe Integer" just another way of overloading types? Seems to me that the result
is the same either way, at least in the case where NULL is returned instead of a pointer
(since a valid pointer never equals NULL).


to post comments

Overloaded types in Samba

Posted May 24, 2007 7:04 UTC (Thu) by roy_hu (guest, #43193) [Link]

In Haskell, the Maybe type is defined as
data Maybe a = Nothing | Just a

So if you're given something of Maybe Integer type, you have to pattern match it with the two constructors in order to get the integer value out of it.

I think his point is that you have to deal with failure upfront; you cannot ignore it.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds