Bug, er, somewhere...

Started by Jeff, August 17, 2007, 11:07:24 AM

Previous topic - Next topic

Jeff

(unless (context? gs) (load "/path/to/guiserver.lsp")) ; => context expected in function set : gs

I understand what's happening... (context? gs) causes gs to get evaluated, setting the value of gs to nil.  Can contexts not be created in established variables?  It works if I delete the symbol after applying 'context? to it.



It's fine that contexts can't be created in existing symbols, but you can see how in the code above the behavior is counterintuitive.  However, if you are testing to see if something is, for example, a context vs an array or a list, you wouldn't want 'delete built into context?.  Hmmm.... not sure on the solution here (aside from something like (unless (context? gs) (and (delete 'gs) (load ...))).  Any ideas?
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

Lutz

#1
like this:



(unless gs:listen (load "guiserver.lsp"))


tests if one of the gs funtions exists and refers to gs as a context.



Lutz

Lutz

#2
The problem is in guiserver.lsp. There are (set 'gs:xxx ...) statements before the (context 'gs) statement. Move the (context 'gs) statement up before those. And (unless (context? gs) (load "....")) will work too.



Lutz



ps: right at the beginning after the long comment section. Move line 681 before 667 -> (set 'gs:black ...)

Jeff

#3
Thanks Lutz!
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code