Message from @Drew West Press
Discord ID: 512702273281851403
Alright bros have something funny
😄
Big Yikes
"hi. Everythings great" said a guy who's getting more popular and then is arrested and killed for being too popular which only makes him more popular. You could make a religion out of this!
Want silk? Now you can buy it from china they just made a brand new road to the world
Or you can get there on water
Sick new trade routes! Said India accidentally spreading there religion to the southeast
anyone ever had much luck overriding operands in JS?
Operator overloading?
you need a transpiled language to really do that
you can sorta do it if you can represent all of your operations as string concatenation
i.e. some sort of JSON metalanguage where you resolve the result in every function you pass it to
that ends up very slow
w/ proxies, you can do slightly more complex things, but the only operator you can really touch is `+`, here's a writeup about doing that: https://medium.com/@julianknodt/javascript-operator-overloading-e1ebd2344b78
I read that one... doesnt seem like it would work.... seems like it would pretty much override everything
no, you only change the toString on the objects you control
anyway, it's a bad idea
I only want to override operands when Im using them on my particluar class(function)
don't do it
The Dr. Who video from Tim is ridiculous. Like really dude... the show has been like since day one on 2005. This is literally nothing new. He's just full of shit at this point.
operands?
what do you mean by override operands?
operands are the things you pass to operators, to be clear.
like + - * /
those are operators
```
This is the operator: v
2 + 2
These are the operands: ^ ^
```
yeah I want to handle the operands when i use an operator 😛
that's called operator overloading
not a thing in JavaScript at all
just knocked up a quick physics engine... it would have been handy to be able to add vectors together without using .add ... ah well 😛
Yeah, it's annoying, but that's the way it are.
You'd have to do similar in C as well.
I'M SO WOKE GUYS IT'S THE TRUTH
also you should probably use functions rather than methods
I was trying something with overriding valueOf .. but it only gets (this) , you dont have the other operand to work with
@Drew West Press
>since day one
>2005
U wot m8
Tim was reporting on claims, and was skeptical of them, and then expressed his opinion on a show
unless you're implementing a vector accumulator
or rather you only have access to (this)
or better yet, use an existing vector math library
there was another article putting the value in a global variable... but that seemed dodgy