2019-10-05

Enumeration (enum) in Perl6

Perl6 has enum. Now I have acquired a little bit of the Ada mindset, so I expected something similar. But Perl6 isn’t Ada, of course, hence I was disappointed. Should I retune my expectations taking into account this fact?

Yes, but also no. Because Perl6 enumeration doesn’t feel completely right.

2019-06-23

Snippet/ Prolog in the Java documentation

Just spotted this:
The type checker enforces type rules that are specified by means of Prolog clauses.
from here.

2019-04-16

Dynamic dispatching reloaded

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.

2019-04-14

Nested functions

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.

2019-04-13

Changing input validation in an established API

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.

2019-03-11

This is google

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.

2019-01-13

“Dynamic overloading” in other languages (not C++)

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?

2019-01-12

Dynamic overloading

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.