From jan@swi.psy.uva.nl  Fri May 12 10:22:06 2000
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id KAA25114;
	Fri, 12 May 2000 10:22:06 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id KAA30689;
	Fri, 12 May 2000 10:22:19 +0200
Date: Fri, 12 May 2000 10:22:19 +0200
Message-Id: <200005120822.KAA30689@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: Atom (was: String) Representation
To: Paul Singleton <p.singleton@keele.ac.uk>, prolog@swi.psy.uva.nl
In-Reply-To: Paul Singleton's message of Thu, 11 May 2000 19:30:35 +0100
Phone: +31 - 20 - 525 6121
Cc: prolog@swi.psy.uva.nl

> Jan Wielemaker wrote:
> 
> > ...  SWI-Prolog
> > has no limitations on length nor content for atoms and they are subject
> > to garbage collection.
> 
> ...which makes them irresistible (to a heretic like me) for holding e.g.
> LONGVARCHAR values retrieved from an RDBMS.  Hence my request: in the
> debugger's "print" mode, when terms are displayed only to max_depth(10)
> or whatever, could very long atoms also be truncated?  OLE Objects can
> be a bit tedious as they scroll past :-)

Might be worthwhile.  For now, you can simply do:

user:portray(LongAtom) :-
	atom(LongAtom),
	atom_length(LongAtom, Len),
	Len > 1000,
	sub_atom(LongAtom, 0, 30, _, Start),
	sub_atom(LongAtom, _, 20, 0, End),
	format('\'~w ... ~w\'', [Start, End]).

(not tested).

	Regards --- Jan

