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 to come last. It makes the formatting look nicer. So,
`member` is likely to have a complicated expression to generate the
list, not to generate the element, so that one goes last. `map` is the
same IF the function is a named function, otherwise, I generally think
the function is going to be longer --- which is one of the weird
benefits of `for/list`. And so on...

Jay

On Thu, Apr 21, 2016 at 6:04 AM, Daniel Prager
<daniel.a.pra...@gmail.com> wrote:
> Does anyone else struggle to remember the order of arguments for some of the
> common functions?
>
> There seem to be two extant conventions, roughly:
>
> object-first: (function obj other)
> object-last: (function other obj): e.g.
>
> Object-first: take, drop, list-ref, add-between, sort
> Object-last: cons, member, remove, map, filter, foldl, foldr
>
> (remove v lst) means "remove the first instance of v from lst" and reads
> ok..
>
> OTOH (take lst n) means "take the first n items from lst", which
> occasionally trips me up, possibly guided by the flipped order in the
> English interpretation.
>
> Am I missing some sort of principal or mnemonic?
>
> How do others cope? Do you make heavy use of the "blue box" in DrRacket?
>
> Dan
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
http://jeapostrophe.github.io

           "Wherefore, be not weary in well-doing,
      for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
                          - D&C 64:33

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to