Why Nostr? What is Njump?
2024-10-20 15:13:25

Dan Piponi on Nostr: In Mathematica you can define a function via pattern matching f[x_]:=x+1 and freely ...

In Mathematica you can define a function via pattern matching

f[x_]:=x+1

and freely redefine it

f[x_]:=x+2

or write a function as a lambda

f = Function[{x},x+3]

But woe betide you if you redefine it using pattern matching after defining it as a lambda

f[x_]:=x+4

as it'll substitute(!!!)

Function[{x},x+3][x_]:=x+4

In reality what happens is you accidentally do this in code to invert a 1000x1000 matrix and now a simple numerical computation becomes the attempt to invert a symbolic matrix with unevaluated subexpressions and it runs out of memory and you lose all your work...
Author Public Key
npub1x78ms56a50yyrl0t6ztxuksk70fp6n5c3wf9u3cl9k8a7g696t5s9nxn0m