On Sun, Apr 26, 2009 at 07:32:05PM +0200, Alexander Burger wrote:
> Now, here is a version which generates the PostScript output more
> intelligently.
Seems I never manage to attach the code to my mails :-(
# 26apr09abu
# (c) Software Lab. Alexander Burger
# *PsGlyph
(in "lib/glyphlist.txt"
(
Hi Alex,
> # *PsGlyph
>
> (in "lib/glyphlist.txt"
>(use (L C)
> (while (setq L (line))
> (unless (=3D '"#" (car L))
> (setq
>L (split L '";")
>C (char (hex (pack (cadr L )
> (set C (pack (car L)))
> (idx '*P
Hi Tomas,
the usage of 'idx' in my implementation had a serious flaw: Because the
unicod values in "glyphlist.txt" are partially sorted, we get a highly
imbalanced tree:
: (depth *PsGlyph)
-> 71
I rewrote it now using 'balance' (and made *Glyph to a local transient
symbol
Hi Alex,
> the usage of 'idx' in my implementation had a serious flaw: Because the
> unicod values in "glyphlist.txt" are partially sorted, we get a highly
> imbalanced tree:
Why does inserting and removing using 'idx' require manual rebalancing
using 'balance' in the first place? I would expect
Hi Tomas,
> In the long-term, wouldn't it be better to put the glyph
> related stuff into @lib/glyph.l and keep access to the full glyph <->
> codepoint mapping?
I see, you are thinking of the PDF generator. At the moment, though,
this involves only a few lines of code, and I don't want to blow u
Hi Alex,
> I would suggest to keep a separate version for other purposes. Is
> this acceptable?
yes, no problem;-)
Thank you,
Tomas
--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
Hi Tomas,
> Why does inserting and removing using 'idx' require manual rebalancing
Well, as always in PicoLisp, this is under the control of the
programmer.
'idx' is deliberately designed in this way. It does only the basic,
straight-forward binary tree operations. This can be quite fast, becaus