Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>What limitation caused this?</p> </blockquote> <p>The reason it isn't possible to do what you describe is probably not caused by any limitation, but it's purely a language design decision. Basically, when designing the language they said "this should be possible but not this". If they really wanted this to be possible, the "limitations" would have been dealt with and this would be possible. I don't know the specific reasoning behind this decision though.</p> <blockquote> <p>/.../ passing a string (causing stringly typed code too!) with those values, turned into strings, and then relying on Regex to try and get the value instead of just using the actual value /.../</p> </blockquote> <p>I have been in similar situations. I sometimes wanted to use attributes with lambda expressions to implement something in a functional way. But after all, c# is not a <a href="http://en.wikipedia.org/wiki/Functional_programming" rel="nofollow noreferrer">functional language</a>, and if I wrote the code in a non-functional way I haven't had the need for such attributes. </p> <p>In short, I think like this: <em>If I want to develop this in a functional way, I should use a functional language like f#. Now I use c# and I do it in a non-functional way, and then I don't need such attributes.</em></p> <p>Perhaps you should simply reconsider your design and not use the attributes like you currently do.</p> <p>UPDATE 1:</p> <p>I claimed c# is not a functional language, but that is a subjective view and there is no rigourous definition of "Functional Language". I agree with the Adam Wright, "/.../ As such, I wouldn't class C# as functional in general discussion - it is, at best, multi-paradigm, with some functional flavour." at <a href="https://stackoverflow.com/questions/393757/why-is-c-sharp-a-functional-programmming-language">Why is C# a functional programmming language?</a></p> <p>UPDATE 2: I found this post by Jon Skeet: <a href="https://stackoverflow.com/a/294259/1105687">https://stackoverflow.com/a/294259/1105687</a> It regards not allowing generic attribute types, but the reasoning could be similar in this case:</p> <blockquote> <p>Answer from Eric Lippert (paraphrased): no particular reason, except to avoid complexity in both the language and compiler for a use case which doesn't add much value.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload