Bug, er, somewhere...

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
Jeff
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Bug, er, somewhere...

Post by Jeff »

Code: Select all

(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...

Artful code

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

like this:

Code: Select all

(unless gs:listen (load "guiserver.lsp"))
tests if one of the gs funtions exists and refers to gs as a context.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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
Posts: 604
Joined: Sat Apr 07, 2007 2:23 pm
Location: Ohio
Contact:

Post by Jeff »

Thanks Lutz!
Jeff
=====
Old programmers don't die. They just parse on...

Artful code

Locked