• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[#Red] Red language group

DocKimbel
12-Mar-2013
[6278x3]
Kaj, I'm really don't see this approach working. The HALTs in the 
runtime code *do* have a purpose, they protect the user from running 
its code after an error that sets the stack in an undetermined state. 
It's a (temporary) protection barrier until we have proper error 
handling. Removing them will just make me chase false errors.  I 
can't patch the whole runtime code to make it look like it has error 
recovering while it has not...
I told you that the cleaner option would be: write a input data validation 
routine to, at least, catch those undefined words.
I think I'll put the HALT back to avoid making the runtime code unstable 
(and avoid those nasty silent errors in unit tests).
Kaj
12-Mar-2013
[6281x3]
I have no idea what you're talking about. What approach? What HALTS? 
What input validation?
I'm just reporting crashes that I observe
Is there any point to continuing testing at the moment? I'm not sure 
now what reports you want
DocKimbel
12-Mar-2013
[6284]
My point is: an undefined word error is a user error, and exiting 
the interpreter with an error message is currently the best thing 
to do. I've removed the exit points after such errors because you've 
asked me to for making your demos run without exiting. But I shouldn't 
have done that.
Kaj
12-Mar-2013
[6285]
I don't really understand. The interpreter never halted on undefined 
words, only undefined paths
DocKimbel
12-Mar-2013
[6286x2]
Same thing.
Paths error out because there's an undefined word in them.
Kaj
12-Mar-2013
[6288]
I know, but you didn't remove a HALT from word evaluation because 
I asked
DocKimbel
12-Mar-2013
[6289x4]
Well, actually, I did. :)
But I will them all back, user errors should make the app exit, currently 
it's the best way.
That's why I told you before to validate the user input in order 
to avoid errors as much as possible.
(Until we can catch them properly with TRY)
Kaj
12-Mar-2013
[6293]
I don't remember you saying that, but I'm looking into it
DocKimbel
12-Mar-2013
[6294]
But it seems we misunderstood each other. :)
Kaj
12-Mar-2013
[6295]
Obviously
DocKimbel
12-Mar-2013
[6296]
See my post on Sun 23:49
Kaj
12-Mar-2013
[6297]
Oh, I see, you were going to implement VALUE? for validation. I just 
didn't think you meant checking the entire input; I thought you were 
talking about the result
DocKimbel
12-Mar-2013
[6298x2]
I meant the whole user input, mainly for catching undefined words/paths 
and hanlding the error out of DO.
Maybe I will do it myself in the console script...
Kaj
12-Mar-2013
[6300x8]
Thinking about it, that would reject any user code that uses words 
as symbols, wouldn't it?
I have a loop written that does the evaluation, even without VALUE? 
but it doesn't seem like a good idea to me
red>> x: load "view button" forall x [print unset? get x/1]      
     
false
true
Undefined single words were never a problem in the interpreter before. 
That's why I could write Redpages with a header:
Red []
They were simply ignored. After I requested the warning message, 
the Red word produces such a warning, so for now I write:
'Red []
By the way, are get-paths supposed to work?
DocKimbel
12-Mar-2013
[6308x3]
Nope, not yet.
DO doesn't support a Red header yet.
You should strip it from a LOADed block before passing it to DO.
Kaj
12-Mar-2013
[6311]
I know, but it worked
DocKimbel
12-Mar-2013
[6312x3]
I need to fix some interpreter issues revealed by Peter's port of 
~2500 tests to the interpreter. There's about a dozen failing tests 
to fix.
Once that done, I will have a look again at those error reporting 
issues.
I agree that it is not yet possible to deeply validate user input. 
I'll see if I can find a cheap workaround for the release.
Kaj
12-Mar-2013
[6315]
OK, thanks
DocKimbel
12-Mar-2013
[6316]
7 failing tests to go until complete equivalence between Red compiler 
and interpreter. :-)
GrahamC
12-Mar-2013
[6317]
nice progress
Bo
12-Mar-2013
[6318]
Great!
Maarten
13-Mar-2013
[6319]
Nice!
Kaj
13-Mar-2013
[6320x8]
I'm getting a weird crash if I load the following in the GTK-browser:
function [] [
	[text]
]
bash-4.0# ./GTK-browser test.red 

*** Runtime Error 1: access violation
*** at: 08063687h
It doesn't happen if I load it in the console
This fixes it:
function [] [
	text: ""
	[text]
]
But this doesn't:
function [] [
	text: none
	[text]
]