The type checker enforces type rules that are specified by means of Prolog clauses.from here.
In previous posts I was exploring a feature I am interested in, and which I have called in many different ways — here I will call it dynamic dispatching.
The previous articles:
Conclusion of those posts: out of the box only Perl6 has it.
The story went on like this: I stirred the net for a solution in C++. And I obtained it.
Some languages allow nested functions (or procedures, or subroutines, or whatever you prefer to call them), others don't.
I think those can be useful and I wonder why they aren't embraced by all living programming languages.
Let's suppose that your server S exposes an API and that this API is used by many clients, or maybe just one — it doesn't really matter.
Let's focus on a client only, let's call it C. Documents were exchanged between S and C, so to agree on the interface.
After that, tests were done and none raised issues or, if they did, they were fixed.
The tests stated that S and C can talk, that they can understand each other, that C calls S correctly, that S acts properly according to the request, that C parses server's answer correctly, and so on.
Everything works fine, or mostly fine, since the beginning.
I am not going to do anything about it. If there are interesting comments, they'll be lost. Hopefully I haven't relied on comments very much — thankfully no one, or few, cared to comment! There are maybe a couple of exceptions in this very same blog. As already written, I am not going to do anything about those, sorry.
But remember: Google can take away from you everything it's given before, and you haven't a say (of course). Hence don't forget that things you can touch in the world are, and always will be, better than anything digital.
In a previous post I've imagined that future C++ could dynamically dispatch a call to a proper function/method according to the derived types of its arguments — that is, dynamic overloading, whereas notoriously in C++ overloading is a compile time feature.
Now the question is: what about other languages?
I have always stated that I dislike C++. “Modern C++” (from C++11 on) changed a lot, but the language still has plenty of dark corners. And limits when you would like to achieve easily some goals, but the language reminds you it doesn't work that way, so things can become more complicated than you would like to think.
Perl5 is a nice useful language, I've always liked it, though sometimes it felt a little bit clumsy. I had some metaphorical headache managing arrays and hashes in few circumstances, for instance, and I've never get really accustomed to the lack of a signature in subroutines. I've barely seen the “new” OO features, and when I tried them, they didn't felt totally right to me. On the other hand, Perl regular expressions are a variant which has spread outside Perl world, likely because they gave something which was missing in basic or extended POSIX regexes.
Perl6 is a totally new language, despite some syntactical and superficial resemblance with Perl5. With respect to the regular expression story, it takes it to a whole new level using a different syntax and introducing grammars which really make easy to write parsers.
Perl6 has many other features, of course: it looks like a very interesting language.
Here I'm going to show something.
I use gmail and I was doing some cleaning to get rid of past things I don't need anymore, until I saw this message:
I am sure that this file (which is a password protected rar archive) is safe and doesn't contain anything dangerous. And by the way I was able to download it in the past. But why is it now blocked? Because now gmail isn't happy with password protected archives. For your safety, of course…
I wanted to check my attachments, too: sometimes I use gmail to send to myself archives of things both in order to transfer them from a computer to another and to keep them in (another) “cloudy” place.
Some of them can't be downloaded neither. Most of them aren't password protected. They are just archives, but it happens they contain other (not password protected) archives. And this is another category now Google isn't happy with. Always for your safety…
Short story: Java hasn't (primitive) unsigned integers because Gosling thinks that too many programmers don't get what goes on with unsigned, what unsigned arithmetic is. Good solution: teach and make them aware, fix the problems of the education system which hasn't taught them, and so on. Bad solution: treat everybody as a stupid unable to learn, remove the feature and disappoint programmers who understand what goes on with unsigned, what unsigned arithmetic is, and those who think they can still learn. End of the story.