Skip to main content
Tweeted twitter.com/#!/StackMma/status/245401951766978560
added 23 characters in body
Source Link
user13253
  • 8.8k
  • 3
  • 44
  • 68
With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] 

How to avoid nested With[] like the above? I'd like to use v1 and v2=f[v1] in the module's body. Is using Module[{v1, v2}, v2=f[v1]; g[v1, v2]] the best/only way to avoid nested module?

With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] 

How to avoid nested With[] like the above? I'd like to use v1 and v2=f[v1] in the module's body. Is using Module[{v1, v2}, v2=f[v1]; g[v1, v2]] the best/only way?

With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] 

How to avoid nested With[] like the above? I'd like to use v1 and v2=f[v1] in the module's body. Is using Module[{v1, v2}, v2=f[v1]; g[v1, v2]] the best/only way to avoid nested module?

added 31 characters in body
Source Link
user13253
  • 8.8k
  • 3
  • 44
  • 68
With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] 

How to avoid nested With[] like the above? I'd like to use v1 and v2=f[v1] in the module's body. Is using ModuleModule[{v1, v2}, v2=f[v1]; g[v1, v2]] the best/only way?

With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] 

How to avoid nested With[] like the above? I'd like to use v1 and v2=f[v1] in the module's body. Is using Module the best/only way?

With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] 

How to avoid nested With[] like the above? I'd like to use v1 and v2=f[v1] in the module's body. Is using Module[{v1, v2}, v2=f[v1]; g[v1, v2]] the best/only way?

Source Link
user13253
  • 8.8k
  • 3
  • 44
  • 68

How to avoid nested With[]?

With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] 

How to avoid nested With[] like the above? I'd like to use v1 and v2=f[v1] in the module's body. Is using Module the best/only way?