Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.3K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Is it possible to hide slots in a function?

Posted 11 years ago
POSTED BY: Eric Johnstone
2 Replies

How about:

divideByBy[divisor_: 1][a_ == b_] := a/divisor == b/divisor

 x^2 == (-2 + y) y // divideByBy[s]

 (*  Out[5]= x^2/s == ((-2 + y) y)/s  *)

 x^2 == (-2 + y) y // divideByBy[]

(*  Out[8]= x^2 == (-2 + y) y  *)

Regards Henrik

POSTED BY: Henrik Schachner

Thanks Henrik,

That is a new notation for me. So the [a_==b_] automatically takes the stuff to the left of the double slashes just like crossMultiply did. This opens a whole new area to explore.

Eric

POSTED BY: Eric Johnstone
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard