Hot answers tagged

4 votes

Destructuring the left-hand-side of `Optional[s:v]`

Edited because I didn't realize that key was intended to be literal. ...
lericr's user avatar
  • 24.5k
3 votes

How to imitate list comprehensions for constant arrays?

There is an infix operator named Star which can be entered as esc star esc and looks exactly like the multiplication sign: ...
eldo's user avatar
  • 48.4k
3 votes

How to imitate list comprehensions for constant arrays?

TagSetDelayed ...
AsukaMinato's user avatar
  • 8,825
3 votes

Destructuring the left-hand-side of `Optional[s:v]`

Edited because I didn't realize that key was intended to be literal. Okay, how about pattern matching at a higher level? ...
lericr's user avatar
  • 24.5k
3 votes

How to imitate list comprehensions for constant arrays?

Define p for python: ...
eldo's user avatar
  • 48.4k
2 votes

Destructuring the left-hand-side of `Optional[s:v]`

Looking at your new example: ReplaceAll[{key}, {key, value_ : 0} : "blah" :> value] This is just a syntax error, because of how ...
lericr's user avatar
  • 24.5k
1 vote

Destructuring the left-hand-side of `Optional[s:v]`

One solution, although not very elegant, is to use Alternatives and manipulate the assignment that shows up in the rule. The way this works is that it replaces all ...
Diffycue's user avatar
  • 1,822
1 vote

How to build the following region?

Somewhat improving your code, the following works well for me. ...
user64494's user avatar
  • 24.3k
1 vote
Accepted

ReplaceAll that works inside Rational?

...
azerbajdzan's user avatar
  • 9,868
1 vote

How to imitate list comprehensions for constant arrays?

Other possibilities ...
user1066's user avatar
  • 15.6k

Only top scored, non community-wiki answers of a minimum length are eligible