Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Scoping of pattern names

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122714] Scoping of pattern names
  • From: Rui <rui.rojo at gmail.com>
  • Date: Mon, 7 Nov 2011 05:53:06 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Reply-to: comp.soft-sys.math.mathematica at googlegroups.com

My goal:
store a pattern in a variable for future use

My problem:
if the pattern I stored has a pattern name in it, (like i_/;i=8),
and I use it later to build a new pattern in which I use the stored pattern twice, it thinks its the same name (i)

My investigation:
So far, couldn't find any way to scope pattern's names in a useful way.
Module and With, refuse to scope a pattern name that's somewhere on the left hand side of a condition contained in them.


Sure, I probably haven't tried much yet to build what I want with hard expression manipulation, but... I found my objective neat simple and useful...
I would like to know if there's a proper way to do this, or to achieve my objective somehow else. And, I'd also enjoy knowing why such a resistance to scope pattern names...





  • Prev by Date: Re: Series expansion question
  • Next by Date: Re: Series expansion question
  • Previous by thread: Re: DumpSave run time
  • Next by thread: Re: Scoping of pattern names