Message from @Drew West Press

Discord ID: 512702273281851403


2018-11-15 18:43:36 UTC  

Alright bros have something funny

2018-11-15 18:43:44 UTC  

😄

2018-11-15 18:44:00 UTC  

Big Yikes

2018-11-15 18:44:09 UTC  

"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!

2018-11-15 18:46:28 UTC  

Want silk? Now you can buy it from china they just made a brand new road to the world

2018-11-15 18:46:49 UTC  

Or you can get there on water

2018-11-15 18:47:51 UTC  

Sick new trade routes! Said India accidentally spreading there religion to the southeast

2018-11-15 18:48:53 UTC  

anyone ever had much luck overriding operands in JS?

2018-11-15 18:51:57 UTC  

Operator overloading?

2018-11-15 18:52:14 UTC  

you need a transpiled language to really do that

2018-11-15 18:52:38 UTC  

you can sorta do it if you can represent all of your operations as string concatenation

2018-11-15 18:52:56 UTC  

i.e. some sort of JSON metalanguage where you resolve the result in every function you pass it to

2018-11-15 18:53:02 UTC  

that ends up very slow

2018-11-15 18:54:25 UTC  

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

2018-11-15 18:55:13 UTC  

I read that one... doesnt seem like it would work.... seems like it would pretty much override everything

2018-11-15 18:55:32 UTC  

no, you only change the toString on the objects you control

2018-11-15 18:55:41 UTC  

anyway, it's a bad idea

2018-11-15 18:55:41 UTC  

I only want to override operands when Im using them on my particluar class(function)

2018-11-15 18:55:42 UTC  

don't do it

2018-11-15 18:55:47 UTC  

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.

2018-11-15 18:55:51 UTC  

operands?

2018-11-15 18:55:57 UTC  

what do you mean by override operands?

2018-11-15 18:56:08 UTC  

operands are the things you pass to operators, to be clear.

2018-11-15 18:56:15 UTC  

like + - * /

2018-11-15 18:56:20 UTC  

those are operators

2018-11-15 18:57:30 UTC  

```
This is the operator: v
2 + 2
These are the operands: ^ ^
```

2018-11-15 18:57:55 UTC  

yeah I want to handle the operands when i use an operator 😛

2018-11-15 18:58:04 UTC  

that's called operator overloading

2018-11-15 18:58:13 UTC  

not a thing in JavaScript at all

2018-11-15 18:59:35 UTC  

just knocked up a quick physics engine... it would have been handy to be able to add vectors together without using .add ... ah well 😛

2018-11-15 19:00:03 UTC  

Yeah, it's annoying, but that's the way it are.

2018-11-15 19:00:15 UTC  

You'd have to do similar in C as well.

2018-11-15 19:00:50 UTC  

I'M SO WOKE GUYS IT'S THE TRUTH

https://cdn.discordapp.com/attachments/463054787336732683/512703544751554561/FFBLmtj.png

2018-11-15 19:00:53 UTC  

also you should probably use functions rather than methods

2018-11-15 19:00:58 UTC  

I was trying something with overriding valueOf .. but it only gets (this) , you dont have the other operand to work with

2018-11-15 19:01:16 UTC  

@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

2018-11-15 19:01:26 UTC  

unless you're implementing a vector accumulator

2018-11-15 19:01:26 UTC  

or rather you only have access to (this)

2018-11-15 19:02:26 UTC  

or better yet, use an existing vector math library

2018-11-15 19:02:27 UTC  

there was another article putting the value in a global variable... but that seemed dodgy