News for hackers. Stuff that matters.
Re:Show HN: Notepad Style Online Calculator by stevekemp on Tuesday June 02, 2020 @03:50AM (#23388698)
It looks nice, although I wonder why you'd treat each line as an independant calculation?

Generally I'd enter an expression, look at the result, then stop. If I wanted to run multiple things I'd use a repl, which would let me copy/paste.

That said it might be useful if you allowed variables to be defined, I updated my own little repl/calculator to allow that recently and found it very useful:

      calc> rent = 700.00
      700
      calc> fee = 92.00
      92
      calc> ( rent - fee ) * 12 
      7296
Allowing that makes your multiline input more useful, although I guess you would need to decide if you'd recalculate all lines using a given variable if it's value changed ..
Re:Show HN: Notepad Style Online Calculator by perryizgr8 on Tuesday June 02, 2020 @05:06AM (#23389139)
Thanks for the feedback! I like the idea of being able to define variables and use them in subsequent lines.

Originally I wrote this purely to try out nearley.js, I was very intrigued by that library. Then I added the IP addresses function because I need to convert IPs to ints fairly frequently in my work. For that the line evaluation made sense.