poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Convention for marking pretty-printers output


From: Bruno Haible
Subject: Re: [RFC] Convention for marking pretty-printers output
Date: Sat, 26 Oct 2019 22:49:57 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-165-generic; KDE/5.18.0; x86_64; ; )

Hi José,

> However, this also leads to long printouts in the REPL that can get
> tiresome to read, ...  That's the reason why poke supports
> pretty-printers.

For a moment, I thought what you wanted is an algorithm that inserts
an appropriate amount of whitespace, in order to transform

BPF_Insn {opcode=BPF_Insn_Opcode {ldst=#<lddw>},regs=BPF_Insn_Regs 
{src=#<%r0>,dst=#<%r0>},offset=0x0H,imm=struct {imm64=#<0000000000000000>}}

to

BPF_Insn {opcode=BPF_Insn_Opcode {ldst=#<lddw>},
          regs=BPF_Insn_Regs {src=#<%r0>,dst=#<%r0>},
          offset=0x0H, imm=struct {imm64=#<0000000000000000>}}

(assuming $COLUMNS = 80).

But I guess this is a different discussion, right?

I'm asking because the algorithm used for this purpose in
Common Lisp [1] is not really good: it has the tendency to move to
the right border quickly and then produce many lines of output,
each beginning with 60 or more spaces. There are better ones.

Bruno

[1] 
http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_22-2-1.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]