MathGroup Archive 2009

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

Search the Archive

Re: Selecting left hand sides from assignments

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97803] Re: [mg97614] Selecting left hand sides from assignments
  • From: "E. Martin-Serrano" <eMartinSerrano at telefonica.net>
  • Date: Sun, 22 Mar 2009 05:47:20 -0500 (EST)

-----Original Message-----
From: E. Martin-Serrano [mailto:eMartinSerrano at telefonica.net]
Sent: Tuesday, March 17, 2009 10:58 AM
To: mathgroup at smc.vnet.net
Subject: [mg97803] [mg97614] Selecting left hand sides from assignments

>Hi,



>I need help on the following.



>From the list of assignments:

 

>assignmentslist = {LHS1 = RHS1, LHS2 = RHS2, LHS3 = RHS3, ..., LHSi = RHSi,
..., LHSn = RSHn}



>I need to extract all the left hand sides (symbols) within a list like:

 

>lhslist = {LHS, LHS2, LHS3, ..., LHSi, ..., LHSn}



>Where the left hand sides are all symbols and the right hand sides are any
expression.



>E. Martin-Serrano
-------------------------------------------

Hi again,

In dealing with the subject of my post above I came across the article (in
notebook form) by Robby Villegas (Wolfram Research) about Working with
Unevaluated Expressions, which begins:

"Most experienced Mathematica programmers will eventually encounter tasks or
applications in which they need to manipulate expressions without letting
them evaluate. (=85) Since Mathematica automatically evaluates arguments and
return values of functions, building up a result without exposing
intermediate stages of work to the evaluator requires subtle techniques that
even seasoned Mathematica programmers sometimes find elusive. In this
tutorial, I will demonstrate situations in which evaluation control is
important, pointing out common pitfalls and providing useful tools and
techniques along the way."

Before posting my question above, I have spent some time looking for my own
way to the solution but I did not get to prevent the lhs of assignments from
being assigned at all. The lack of responses to my question tells me that
either it is fairly clumsy or there is not an easy answer. So I insist.

One of the sources I consulted in my search was the Robby's article
mentioned above. However the only thing I found in it about *Set* and
*SetDelay* tells me that these are not the easiest clauses or commands to be
"manipulated" in the way I want. Robby Villegas himself ends the article
with some remarks about "Left-hand side of but leaving them without any
treatment; insisting in how special they are and saying that both commands
can be made more flexible. Then he announces that he will expand the article
to solve the following issues:

- Evaluate certain parts of *SetDelayed* rhs as exceptions.
- Don't evaluate certain parts of *Set* rhs as exceptions.

Robby finally says: "I will include these examples in the next revision of
this document (Working with Unevaluated Expressions)."

Now, since "leaving unevaluated certain parts of *Set* rhs as exceptions" is
the main part of the solution to my problem, my question is:

Does anyone know whether Robby Villegas wrote his next revision of the
document including the new material, and, if so, where I could find it?

The Robby Villegas's notebook was referenced in the last version that I know
of the Ted Ersek Tricks.

I hope Robby himself read this post.

Best regards

E. martin-Serrano.



  • Prev by Date: Re: Re: Re: Using Mathematica notebooks in presentations?
  • Next by Date: Got a tip ?
  • Previous by thread: Selecting left hand sides from assignments
  • Next by thread: Re: Re: Selecting left hand sides from assignments