[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Libtextstyle in Jitter and Poke: sub-package mode and CSS installati
From: |
Luca Saiu |
Subject: |
Re: Libtextstyle in Jitter and Poke: sub-package mode and CSS installation |
Date: |
Wed, 30 Oct 2019 19:25:26 +0100 |
User-agent: |
Gnus (Gnus v5.13), GNU Emacs 27.0.50, x86_64-pc-linux-gnu |
Hello José.
On 2019-10-30 at 09:37 +0100, Jose E. Marchesi wrote:
> I would have expected for the Jitter user (in this case poke) to provide
> whatever customizations for the classes. Jitter should provide a list
> of these classes.
But why? It is fine if you want to override them because you dislike
some default, but Jitter's classes are VM-independent, and only deal
with VM code and disassembly. There is nothing directly interesting for
Poke there.
> I achieve that using a custom printer:
>
> void
> pvm_literal_printer (FILE *out, jitter_uint val)
> {
> /* XXX what about out. */
> fflush (out);
> pvm_print_val ((pvm_val) val, poke_obase, 0);
> pk_term_flush ();
> }
>
> Note the flushing and the fact I'm not using `out'.
The fact that you are *not* using out when doing your own printing is
more interesting, to me. Your printer, if I understand correctly,
relies on the output being on stdout, and it would misbehave if you
wanted to print a VM program to stderr or to an actual file, for
example.
> [...]
>
> It is expressive. But I don't understand why the user cannot print
> structured literals with internal styling in the custom printers. I am
> doing exactly that right now.
As long as I am not misunderstanding, your solution is good as a
temporary fix. But a good printer API should support output to any
stream.
Of course in the good printer API the FILE * argument will be replaced
by something more abstract -- but not a libtextstyle stream, because
libtextstyle might be unavailable or disabled. It will be something
abstract.
And still, even if the printer received a libtextstyle stream as a
parameter, that would not be helpful to you: my output style is for
printing Jittery VM routines, while yours is for printing Poke's data.
So they would be two different, incompatible streams.
The literal printer should only see yours.
--
Luca Saiu
* My personal web site: http://ageinghacker.net
* GNU epsilon: http://www.gnu.org/software/epsilon
* Jitter: http://ageinghacker.net/projects/jitter
I support everyone's freedom of mocking any opinion or belief, no
matter how deeply held, with open disrespect and the same unrelented
enthusiasm of a toddler who has just learned the word "poo".
signature.asc
Description: PGP signature
Re: Libtextstyle in Jitter and Poke: sub-package mode and CSS installation, Luca Saiu, 2019/10/30