[racket-dev] Argument positions of string-... like functions

2012-04-19 Thread Laurent
   (define (string-index-of sub str [start 0] [end (string-length str)])


I always need to go check the documentation for that kind of argument
position (like for (string-replace from str to) ).
To me, what makes more sense is to have the str argument on the first
position, just like for a method call with a self argument, which makes
sense for strings on functions like string-
Does it bother other people too?

Laurent
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Argument positions of string-... like functions

2012-04-19 Thread Eli Barzilay
A few minutes ago, Laurent wrote:
   (define (string-index-of sub str [start 0] [end (string-length str)])
 
 I always need to go check the documentation for that kind of argument position
 (like for (string-replace from str to) ).
 To me, what makes more sense is to have the str argument on the first
 position, just like for a method call with a self argument, which makes sense
 for strings on functions like string-
 Does it bother other people too?

(I was about to suggest the same thing.  The `string-replace' not
following `regexp-replace's order is the bad point here.)

-- 
  ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
http://barzilay.org/   Maze is Life!

_
  Racket Developers list:
  http://lists.racket-lang.org/dev