Gábor Csárdi

Results 2061 comments of Gábor Csárdi

Good idea, and I think it would be great to define it up front, so that one can see what to expect just by looking at the function header. How...

This sounds a little scary. :) Isn't it simpler to redefine `return()`? Plus deal with the last expression separately. As for syntax, the second one is not bad. The third...

Now that the assertions are in the docs, this is easy, of course, as least the syntax. You can just do something like: ``` r #' @return \assert{is.integer(.)} The number...

I think this could work, although it is somewhat more difficult, because you want to return `x`, not the logical from the assertion: ``` r function(x) { if (is.numeric(`_`

This is quite good. My only very minor complaint is that it messes up the code of the function somewhat, it will be harder to read, especially smaller functions. I'll...

Unfortunately there is no srcref by default because packages are parsed without it. In theory we could re-parse and add it, but I am not sure if we want this,...

Certainly a possibility to keep in mind. TBH I am not so keen on doing it, I feel that the less extra we put on the function the better, and...

I know I am stubborn, but I just don't like putting it after the function body. I think this is where Stefan's approach in ensurer is better. If you have...

Essentially my only argument for having it up front, is that then you can see all information about arguments and return values (essentially the whole API of the function) together,...

One last try. How about putting it among the function arguments, anyway: ``` r f