DennisMitchell / jellylanguage

Jelly is a recreational programming language inspired by J.
MIT License
860 stars 47 forks source link

Improve `D` (decimal) atom #59

Open Reconcyl opened 6 years ago

Reconcyl commented 6 years ago

Make D (to decimal) take the ord first if given a character.

GolfingSuccess commented 6 years ago

@ScratchMan544 Why should it take the ordinal of a character and not just the digit the character itself represents ([0-9]) or 0 if the character is not a digit? That's how bit-wise functions (&, |, ^, ~) behave.

Reconcyl commented 6 years ago

Taking the digit the character represents is not a particularly useful operation in this cae – after all, we're converting to decimal, so that would essentially just be an "eval". The reason I chose the ordinal is because that's what I actually found useful when golfing.