Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-22 Thread Jukka Tuominen
Not to give an excuse to design the argument order poorly... it would be great if DrRacket could display named place-holders for each argument dynamically. Then you wouldn't need to guess or try to remember illogical set of parameter orders. The argument name could be taken dynamically from the

Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-21 Thread Eugene Wallingford
> Eugene Wallingford wrote on 04/21/2016 11:18 AM: > > This also reminds me fondly of Smalltalk's separable message > > names. They always felt more natural to me than more typical > > keyword arguments. > > On a tangent, Smalltalk-like names weren't hard to implement just now, wi

Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-21 Thread Neil Van Dyke
Eugene Wallingford wrote on 04/21/2016 11:18 AM: This also reminds me fondly of Smalltalk's separable message names. They always felt more natural to me than more typical keyword arguments. On a tangent, Smalltalk-like names weren't hard to implement just now, with `syntax-p

Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-21 Thread Daniel Prager
Great comments. Thank-you! I think that for the purposes of remembering "take and drop family functions are backwards / wrong" should suffice, or train myself to think "from list L take n elements", etc. Another point that occurred to me is that the common library naming convention of object-fn (

Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-21 Thread Eugene Wallingford
On Thu, Apr 21, 2016 at 08:07:36AM -0700, Jordan Johnson wrote: > 1) With many of these functions, there's usually an imaginary preposition > there, when I read most of them functions: > > sort ls by > > cons X onto ls > remove X from ls > map f over ls I think this way when I design a fun

Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-21 Thread Jordan Johnson
1) With many of these functions, there's usually an imaginary preposition there, when I read most of them functions: sort ls by > cons X onto ls remove X from ls map f over ls 2) Any "-ref" function — list-ref, vector-ref, hash-ref — has the object first. Longstanding Scheme/lisp convention, an

Re: [racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-21 Thread Jay McCarthy
I believe the actual principle is, "Scheme did this" and "LISP did this" so "We do this." I don't think that's necessarily a good reason though. :) I generally prefer object-first, but sometimes not. If I were to dig down to when, I would say that I want the expression that is likely to be longest

[racket-users] Order of argument conventions, or ... conventions of argument ordering

2016-04-21 Thread Daniel Prager
Does anyone else struggle to remember the order of arguments for some of the common functions? There seem to be two extant conventions, roughly: 1. object-first: (function obj other) 2. object-last: (function other obj): e.g. Object-first: take, drop, list-ref, add-between, sort Object-las