dictu-lang / Dictu

Dictu is a high-level dynamically typed, multi-paradigm, interpreted programming language.
https://dictu-lang.com
MIT License
267 stars 53 forks source link

Add negate method to number type #677

Closed briandowns closed 1 year ago

briandowns commented 1 year ago

Add negate method to number type

Resolves: #

What's Changed:

Adds a new method, negate, to the number type.

Type of Change:

#

Housekeeping:

#

Screenshots (If Applicable):

Jason2605 commented 1 year ago

Hmm interesting, we can use - as a prefix operator rather than a function call for negating a number - do you think we need this as a method?

const x = 100;
print(-x); // - 100
briandowns commented 1 year ago

Probably unnecessary then. I'll defer to you if you want it in the language. I'm happy to close the PR if you don't. 😀

Jason2605 commented 1 year ago

Appreciate the PR but I think we probably don’t need it

briandowns commented 1 year ago

Cool, cool. Closing.