D is awesome, my situation, questions

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Jun 3 18:49:27 PDT 2006


<mike.benfield at gmail.com> wrote in message 
news:e5tact$2htp$1 at digitaldaemon.com...

> variant types, pattern matching, real closures...

Hehe, pattern matching.  Funny you mention that, as there was a brief (read: 
2-week) period when D had built-in regexp operators (~~ for match and !~ for 
not match), but it was determined that something like that doesn't belong in 
the core language, and was also too dependent upon the implementation of the 
standard library.  You can still do regular expressions, though, using 
std.regexp.  And there's also a template (!) version of regexps floating 
around somewhere.

And funny that you mention real (static) closures as well - check out the 
"Suggestion "new delegate"" thread, for Walter's view on the issue (kind of 
unfortunate, but I know where's he's coming from on the issue).

And lastly, variant types - I suppose if you're still thinking in 
"dynamically typed" terms, you'd miss them, but I've never needed anything 
like them; when thinking in object-oriented terms, anyway, polymorphism is 
usually more than enough, and when you need something that can accept 
multiple types, there's templates.  You might also want to look into 
std.boxer - the Box type is basically a typesafe variant. 





More information about the Digitalmars-d mailing list