Streamable DOM and obsolete put_code/[1,2]

Liste des GroupesRevenir à cl prolog 
Sujet : Streamable DOM and obsolete put_code/[1,2]
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : comp.lang.prolog
Date : 02. Apr 2025, 10:51:20
Autres entêtes
Message-ID : <vsj1an$m6gi$1@solani.org>
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.20
Hi,
The development of Novacore takes interesting turns.
Originally more accidentially, because I observed it
can serve a few interesting use cases, like atomic
logging with some unspoken or spoken gurantees,
I introduced put_atom/[1,2] in Novacore streams:
 > put_atom(S, A):
 > The built-in succeeds. As a side effect, it adds
 > the atom to the stream S.
Now because I am revising my streamable DOMs, the
"HTML writer" part, I even went so far as to
bootstrap put_code/[1,2] from it:
 > put_code(Stream, Code) :-
 >    char_code(Atom, Code),
 >    put_atom(Stream, Atom).
One can eliminate each put_code/[1,2] call such
as put_code(S, 0'\n) by a put_atom/[1,2] call
such as put_atom(S, '\n'). The performance is the
same, in my case can be slighly better since under
the hood put_code and put_atom called the same
stream meachnism.
But the main reason I eliminate put_code was
to have a single point. Because the Prolog
write_term/1 is 100% written in Prolog, in the
end it only only uses put_atom.
Bye

Date Sujet#  Auteur
2 Apr 25 * Streamable DOM and obsolete put_code/[1,2]7Mild Shock
2 Apr 25 +* Re: Streamable DOM and obsolete put_code/[1,2]5Mild Shock
2 Apr 25 i`* Re: Streamable DOM and obsolete put_code/[1,2]4Mild Shock
5 Apr 25 i `* Space Junk might fall on your head [Scryer Prolog WASM] (Was: Streamable DOM and obsolete put_code/[1,2])3Mild Shock
5 Apr 25 i  +- Editor’s Draf, 10 January 2025 - Trusted Types (Was: Space Junk might fall on your head [Scryer Prolog WASM])1Mild Shock
25 May12:48 i  `- *** 2025 Prolog Awards *** (Was: Space Junk might fall on your head [Scryer Prolog WASM])1Mild Shock
7 Apr 25 `- Code Generation with write/[1,2] [Some Testcases] (Was: Streamable DOM and obsolete put_code/[1,2])1Mild Shock

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal