Ecere SDK/eC Forums https://ec-lang.org/community/ Print view |
|
Function overloading and function with default parms https://ec-lang.org/community/viewtopic.php?f=1&t=248 |
Page 1 of 1 |
Author: | samsam598 [ Mon Aug 13, 2012 9:33 pm ] |
Post subject: | Function overloading and function with default parms |
Greetings! Just for fun,I would like to know why don't allow eC to support such two features,that is: Code: Select all
Code: Select all
Sam |
Author: | jerome [ Mon Aug 13, 2012 10:18 pm ] |
Post subject: | Re: Function overloading and function with default parms |
Hi Sam, 1 --> Function overloading -- I have something against it, for the sake of clarity. When I'm in function CalString() (e.g. while debugging), I know exactly where I am. If there are 2 functions named 'cal', to me, that is extremely confusing. Sorry for those who like overloading =) I hate it. 2 --> Default parameters... I don't have such a strong opinion against it as overloading, but sometimes it can be confusing as to whether a function has default parameters or not, or what the default parameters are... I agree it can be useful though, especially if parameters can be named on the arguments line, like eC instance member initializers (which I don't think C++ supports, but maybe Python does?) Classes have default members/property values, which can sometimes achieve a similar goal... You can set values on an instance and then run a method with no (or less) arguments: Code: Select all
If there's a feature you would like to see in the compiler, feel free to report an issue on mantis ( http://ecere.com/mantis ) with Severity set to Feature, Category set to Compiler, and we can review it when the time comes... Right now however our resources are spread thin already with many things, so it's unlikely we'll be working on implementing such a feature soon... The current focus is ironing out bugs and support the Android platform! About a String class, we still have a lot of work to do to make it easy to handle strings in eC. At the moment it's pretty much just like in C + a few utility functions. There is a tracked issue http://ecere.com/mantis/view.php?id=177 for which this is the focus. It is planned in the future, currently assigned to 0.46 milestone ( https://launchpad.net/ecere/+milestone/0.46 ), but we'll see when we get to it... Hopefully sooner than later! In the meantime, you could use your own string class: Code: Select all
Code: Select all
Note that major issues which makes it tricky to decide how the String class will work is the memory management, and whether to represent it as a char * only or as an object which will contain members... Hope this helps! Thanks for the suggestions!! All the best, Jerome |
Author: | samsam598 [ Tue Aug 14, 2012 2:53 am ] |
Post subject: | Re: Function overloading and function with default parms |
Hi Jerome, Thanks for the reply.Glad to see the bug fix been keeping on maintained everyday,really appreciated! Regards, Sam |
All times are UTC-05:00 | Page 1 of 1 |
Powered by phpBB® Forum Software © phpBB Limited |