Timeline for How many arguments were passed?
Current License: CC BY-SA 3.0
15 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2020 at 9:04 | history | edited | Community Bot |
Commonmark migration
|
|
| Dec 15, 2018 at 17:31 | comment | added | dana |
There may be some benefits to using the dynamic type over object => delegate int F(params dynamic[] a);. This saves you from having to type cast the args.
|
|
| Apr 11, 2018 at 16:17 | comment | added | Kamil Drakari |
Well... I don't know if this was missed or has simply been changed, but reading the Challenge again it appears that both "Supporting only up to a maximum number of inputs" and "Supporting only specific data types" are allowed, so the solution is valid as-is with the simple note "supports data types other than object[]", though some other use of those allowances could save characters.
|
|
| Apr 11, 2018 at 15:43 | history | edited | Kevin Cruijssen | CC BY-SA 3.0 |
deleted 656 characters in body
|
| Apr 11, 2018 at 15:43 | comment | added | Kevin Cruijssen |
@KamilDrakari Hmm, but it fails for f(1, new object[]{1,2,3}) again though. Not sure if a solution for this behavior can be found.
|
|
| Apr 11, 2018 at 15:23 | history | edited | Kevin Cruijssen | CC BY-SA 3.0 |
added 700 characters in body
|
| Apr 11, 2018 at 15:10 | comment | added | Kamil Drakari | this handles array parameters correctly for a huge penalty of bytes. There might be a more concise structure that can handle it, but it works in my testing. | |
| Apr 11, 2018 at 15:00 | history | edited | Kevin Cruijssen | CC BY-SA 3.0 |
added 373 characters in body
|
| Apr 11, 2018 at 14:58 | comment | added | Kevin Cruijssen |
@Taemyr I tried finding a solution, but unfortunately there is none for C# .NET, except for casting any object[] parameters to object, like this: f((object)new object[]{1,2,3});. There is no way to differentiate between f(new object[]{1,2,3}); and f(1,2,3); as far as I could find.
|
|
| Apr 11, 2018 at 14:17 | comment | added | Taemyr | Fails when passed a single array as argument. Ie. f(new object[]{1, 2, 3}) | |
| Apr 11, 2018 at 9:29 | history | edited | Kevin Cruijssen | CC BY-SA 3.0 |
Added explanation
|
| Apr 11, 2018 at 9:25 | comment | added | Kevin Cruijssen | @KamilDrakari Maybe it indeed wasn't very clear what I did without opening the TIO-link, so I've added an explanation. | |
| Apr 11, 2018 at 9:24 | history | edited | Kevin Cruijssen | CC BY-SA 3.0 |
Added explanation
|
| Apr 10, 2018 at 15:23 | comment | added | Kamil Drakari | I have to say, if there were ever an answer that made me support including lambda-related boilerplate in C# answers it would be this one... but it is definitely a valid solution. | |
| Apr 10, 2018 at 12:33 | history | answered | Kevin Cruijssen | CC BY-SA 3.0 |