From jan@swi.psy.uva.nl Mon Feb  4 21:56:32 2002
Received: from gollem.swi.psy.uva.nl (root@gollem.swi.psy.uva.nl [145.18.152.30])
	by swi.psy.uva.nl (8.11.6/8.11.2) with ESMTP id g14KuWp19055;
	Mon, 4 Feb 2002 21:56:32 +0100 (MET)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.6/8.11.6/SuSE Linux 0.5) id g14KuV209900;
	Mon, 4 Feb 2002 21:56:31 +0100
Date: Mon, 4 Feb 2002 21:56:31 +0100
Message-Id: <200202042056.g14KuV209900@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: More SWI questions
To: Christophe Costa Florencio <costa@let.uu.nl>
In-Reply-To: Christophe Costa Florencio's message of Mon, 4 Feb 2002 21:36:42 +0100 (MET)
Phone: +31 - 20 - 525 6121
Cc: prolog@gollem.swi.psy.uva.nl, xpce-users@gollem.swi.psy.uva.nl

Christophe,

> zoals verzocht voortaan in het Engels:

Mooi.

> Minor issue: would you consider adding the command proper_subset? SWI has
> list/1 and proper_list/1, after all.

If it complies to any standard, no problem.  Searching for
"proper_subset prolog" didn't give any answers though.  

> By mistake I recently created a list_browser with an uninstantiated dict
> as argument, SWI hung up on me. I could reproduce this.
> Shouldn't SWI (or PCE) raise an error in this case?

In theory yes.  I did the trivial test and it reported correctly, so
please send me something to reproduce.

> Is there or will there be support for tabs in PCE?

There is.  Have a look at the classes tab_stack and tab.  There should be
examples in the default applications.  It is quite simple though: tabs
behave as dialog windows, you add multiple to a tab_stack and the result
is a graphical you can display on a dialog or any other window.

> In case multiple objects of the same name are created and attached to, say, a
> frame: to get the reference for one of these objects, is setting
> current_no for its chain and get(Chain, current, Element)
> good style? In other words, is the chain guaranteed to contain elements
> in the same order as they were created in the initialise method?

Not really.  chains have methods to manipulate the order.  Frames don't
use this, but graphical devices manipulate this order to play with the
stacking-order (foreground...background).  Best way to locate windows
and graphicals in a device or frame is to give them unique names.

> Re unifying w/o occurs check: I'm just curious, how is the
> resulting term represented internally? How is printing of infinite objects
> implemented? It seems to me there must be a check for cyclicity somewhere

It isn't.  There is a depth-limit to printed terms (see the
option-list in write_term/[2,3]).  The toplevel uses this limit.

> in the printing routine(s). Doesn't that slow things down?
> Is it possible to have SWI raise errors for this kind of thing (other
> than using unify with occurs check)?

At the moment, no.  Cyclic terms can be created and to a certain extend
manipulated.  Some routines however run out of (stack-) space, others go
into an infinite loop as most internal term-manipulation does `last-argument'
optimisation, allowing it to handle terms extremely deeply nested on the
last argument.

	Cheers --- Jan

