Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: let's re-visit math oper. in a var.

From: gregg:pointillistic at: 3-Apr-2009 14:54

Hi Duke, mgc> Anyway, I'm also studying (and liking) an old "database" language mgc> called Mumps or "M" - heavily used in the Healthcare and financial mgc> circles. That little "calculator routine" that I was using as a mgc> "sandbox" took me 10 minutes to write properly in Mumps, including mgc> error trapping. Just another tool in my toolbelt... What does the result look like in M (is it Cache' or something else you're using)? Earlier I asked about what you expected it to work like, because that's one of the things that trips people up when they come to REBOL from other languages. In other languages that support an eval concept, there is code, and you can build up strings and call "eval" on them, interpreting them as code. The equivalent in REBOL is DO, but there is much more flexibility in REBOL. DOing strings is rare. You are much better off building up blocks. The hard part here, with your example, is that user input is going to start out as strings and you need to convert it to REBOL types. And what you might normally do in REBOL, for a problem like this, is build up the input and use PARSE, but I don't usually throw that at newcomers as an answer, because it's "overload time" if you're just getting started with REBOL. I think the biggest <click> in my head was when I finally understood that there is no code in REBOL, there is only data that is evaluated. -- Gregg