The idea it was named after

Sunday, September 11, 2005

Non sequitur

This is a term that means "it doesn't follow". Vamos, que no se sigue. Who doesn't like to be like that sometimes?

I love programing, just for fun. Now I'm going to start a new project written in C++, called Aeromodels Virtual Designer. It will be my first graphical program and big project in such a language. I'll talk about it later on. The thing is that I'm preparing to bbe up to the task, and now I'm finally finishing reading the Thinking in C++ book. I was learning the usage of operators overloading and thought: what the heck, let's try to implement multiple assignation in C++!

Multiple assignation means that you can do something like this:

a, b, c = d, e, f;

Yeah, and it works! I have the example code for you. Given that code, this is the output in my system when I execute it:


$ g++ multassign.cpp -o multassign && ./multassign
0xbffff7c0: 1
0xbffff7b8: 2
0xbffff7b0: 3
0xbffff7a8: 4
0xbffff7a0: 5
0xbffff798: 6
0xbffff790: 7
0xbffff788: 8
0xbffff780: 9
0xbffff778: 10
0xbffff770: 11
0xbffff768: 12
-----
a = b;
b, c, d = e, f, g;
e, f, g, h = i, j, k, l;
-----
0xbffff7c0: 2
0xbffff7b8: 5
0xbffff7b0: 6
0xbffff7a8: 7
0xbffff7a0: 9
0xbffff798: 10
0xbffff790: 11
0xbffff788: 12
0xbffff780: 9
0xbffff778: 10
0xbffff770: 11
0xbffff768: 12


All right, so you noticed it? It doesn't support yet to do something like:

a, b = c, d;


Why? Because it's difficult to implement so many things at once hehe. I think I only need to refactor some code, perhaps add some temporal vars and add some code to deal with the special case. Maybe today I'll finish it, because it's certainly possible to do.

4 Comments:

  • Why do you write in English? This isn't going to make your blog international.

    By Anonymous Anonymous, at 11 September, 2005 12:29  

  • Why not is a better question. I have already stated why I'm writting this blog in english in my first entry but I'd like to explain it better:

    This site is available in the whole network. Maybe just writting it in english is not enough to make it international; it must be interesting also. But writting it english is an exercise for me, and it will allow me to reach to more people. Specifically, people interested in computer science and software development, and most of them understand english.

    Nevertheless, If you want it in another language, you should notice that this weblog is under public domain; anyone is free to translate it to any language. The only restrictions are the ones provided by the spanish law: you need to mention the original author and you cannot use it in a offensive manner.

    By Blogger Eduardo Robles Elvira, at 11 September, 2005 13:10  

  • Easy... writing in English gives you more audience. That way you are more likely to get help if you ask for it :)

    Cheers,
    Ferdy

    By Anonymous ferdy, at 11 September, 2005 14:00  

  • Anyway, your english is fantastic. Youy are fooling us, you are just scottish

    By Anonymous Anonymous, at 14 September, 2005 13:26  

Post a Comment

<< Home