Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Combining several pure functions into a single pure function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg7303] Re: [mg7262] Combining several pure functions into a single pure function
  • From: penny at suu.edu (Des Penny)
  • Date: Fri, 23 May 1997 01:41:32 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Bob:

How about this:


=============================================
f1=Length[#[[1,1]]]>2&;
f2=Length[#[[3,1]]]>4&;

test=
        ToExpression[
                StringJoin[
                        StringReplace[ToString[f1 || f2], "&"->" "],"&"]];

mylist={{{1,2,3},1},{1,2},{4,5}};

test[mylist]
=============================================

Out: True


In the above, I constructed the compound test f1 || f2, converted it to a
string, took out the "&" everywhere, put the "&" back in at the end, then
converted everything back into an expression.  The final "test" seems to do
what you want.

Cheers,

Des


-------------------------------
Des Penny
Physical Science Dept.
Southern Utah University
Cedar City, UT 84720

VOICE: (Office): (801) 586-7708
       (Home)  : (801) 586-2286
FAX:    (801) 865-8051
e-mail: penny at suu.edu
-------------------------------




  • Prev by Date: Using Sqrt[x_]/y_ ->
  • Next by Date: Re: "Save Graphic As BMP" problems...
  • Previous by thread: Re: Combining several pure functions into a single pure function
  • Next by thread: Re: Contexts