Re: [cc65] Feature request: default arguments for functions.

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2009-07-25 19:00:25
Hello Markus,

* On Sat, Jul 25, 2009 at 06:45:06PM +0200 Markus Stehr wrote:
 
> Could this be put on the todo list please? It would be a nice feature to
> have. I mean something like this:
> void putbigchar(char x, char y, char c, char co=1);

You are aware that CC65 tries to be a C compiler, not a C++ compiler?

> Its not urgent, but it would be a nice feature to have. :)

You mean, it would be nice to hide that a function call

   f(a);

might involve pushing 30 arguments on the stack, but it is not visible
to the programmer? Yes, that sounds very C++ like.

I fail to see the benefit of it.

> I dont know the compiler interna, but i think this could be done on
> preprocessor level. If i just write putbigchar(foox,fooy,'a'); the
> prepro would automaticaly expand this to putbigchar(foox,fooy,'a',1);
> No need to touch the compiler itself. ;)

I doubt this. In order to do what you want, the instance which does this
needs to know the prototype of the function. The preprocessor does not
know about this.

Regards,
Spiro.

-- 
Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jul 25 19:00:46 2009

This archive was generated by hypermail 2.1.8 : 2009-07-25 19:00:48 CEST