Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another easy one:
#7
(12-10-2023, 05:01 AM)SMcNeill Wrote:
(12-10-2023, 04:53 AM)a740g Wrote: This is a rather intriguing idea. Personally, I love the idea of having an easily accessible math expression evaluator built into the language. However, Val historically have never parsed expressions. Doing this now, would be a breaking change. Perhaps we can expand Val like n = Val("3 * 3", -1), where the second optional argument would tell Val to enable the parser. No promises. Just thinking out loud.  Big Grin

Personally, I think this would be a terrible idea.  Basically, you'd be moving the math evaluator which we use for CONST and applying it to Val... and I can hear the complaints already!!  "Why isn't this command implemented?  Why can't I do VAL ("3 * INSTR(x$, "foo")")?  Or VAL("(ASC("B")")?  OR....

I predict nightmares for whoever is going to try to implement such.  

Instead, we should consider having a Resources folder, include the math evaluator in it, and then folks can just:

Code: (Select All)
PRINT Math$("3 * 3")
'$INCLUDE:'./Resources/math_eval.bas'
Now that you've said that... Yeah. The scope creep could be a disaster. This is best left to 3rd party libs.
Reply


Messages In This Thread
Another easy one: - by PhilOfPerth - 12-10-2023, 04:46 AM
RE: Another easy one: - by a740g - 12-10-2023, 04:53 AM
RE: Another easy one: - by SMcNeill - 12-10-2023, 05:01 AM
RE: Another easy one: - by a740g - 12-10-2023, 07:05 AM
RE: Another easy one: - by SMcNeill - 12-10-2023, 04:53 AM
RE: Another easy one: - by PhilOfPerth - 12-10-2023, 05:09 AM
RE: Another easy one: - by SMcNeill - 12-10-2023, 05:11 AM
RE: Another easy one: - by euklides - 12-11-2023, 01:53 PM
RE: Another easy one: - by SMcNeill - 12-11-2023, 04:05 PM
RE: Another easy one: - by JRace - 12-13-2023, 02:26 AM



Users browsing this thread: 1 Guest(s)