Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Replace list element based on a condition how to

3 views
Skip to first unread message

Canopus56

unread,
Jan 23, 2010, 7:30:18 AM1/23/10
to
Thanks to all for the many great replies in this thread. That clears up my misunderstanding of how datatypes are implemented in Mathematica. I can see they may result in replace pattern failures if you are not mindful of a variable's datatype. - Kurt

----- Original Message ----
From: Bill Rowe <read...@sbcglobal.net>
Sent: Fri, January 22, 2010 3:40:26 AM
Subject: Re: Replace list element based on a condition how to

On 1/21/10 at 4:53 AM, cano...@yahoo.com (Canopus56) wrote:

>Another newbie type question.� Several responders recommended:

>>In[18]:= lst1 /. n_Integer :> fncHourFix[n]

>Q1.� What is the "_Integer" part of "n_Integer"?

This and more is answered in the documentation. See
tutorial/PatternsOverview for various details about patterns and
pattern matching. For a the specific answer to the question
above, see the fourth entry which can be directly accessed as tutorial/SpecifyingTypesOfExpressionInPatterns
. . ..

0 new messages