Article View: comp.lang.lisp
Article #51Re: on cl-json and slashes
From: Kaz Kylheku
Date: Wed, 18 Nov 2026 06:11
Date: Wed, 18 Nov 2026 06:11
41 lines
2366 bytes
2366 bytes
On 2026-11-18, steve g <Sgonedes1977@gmail.com> wrote:
> Anton Antimo <anton@safunu.org> writes:
>
>
>> I'm just curious why someone would escape slashes and make it the
>> default on a library to handle JSON (of any sort).
>
> Microsoft.
I'm obviously not Microsoft:
This is the TXR Lisp interactive listener of TXR 302.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
1> (put-json #("foo" "/bar"))
["foo","/bar"]t
2> (put-json #("foo" "</bar"))
["foo","</bar"]t
3> (put-json #("foo" "</s"))
["foo","</s"]t
4> (put-json #("foo" "</sc"))
["foo","</sc"]t
5> (put-json #("foo" "</scr"))
["foo","</scr"]t
6> (put-json #("foo" "</scri"))
["foo","</scri"]t
7> (put-json #("foo" "</scri>"))
["foo","</scri>"]t
8> (put-json #("foo" "</script>"))
["foo","<\/script>"]t
Yes, escaping every slash, regardless of whether it causes a
script end tag ambiguity, would annoy users.
A slash is a path separator; a shit ton of strings that end up in JSON contain
URLs and paths. To have a backslash on each path separating slash would be
insane.
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
Technical Details
Message-ID:
<20261117220524.407@kylheku.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<87jymcbkom.fsf@safunu.org> <11dg1qo$3veh5$1@dont-email.me> <87y0ar92sn.fsf@safunu.org> <878q2q4tgl.fsf@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <046-301-5902@kylheku.com> Newsgroups: comp.lang.lisp Subject: Re: on cl-json and slashes Date: Wed, 18 Nov 2026 06:11:13 -0000 (UTC) Organization: A noiseless patient Spider Lines: 41 Message-ID: <20261117220524.407@kylheku.com> References: <87jymcbkom.fsf@safunu.org> <11dg1qo$3veh5$1@dont-email.me> <87y0ar92sn.fsf@safunu.org> <878q2q4tgl.fsf@gmail.com> Injection-Date: Wed, 18 Nov 2026 06:11:14 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1153712"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BQPvK8SKUBPen3Cvdbfirakb8aJbNU2M="; posting-host="a4e765937eb99fc8bc980c57921d9b30" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:O//31OzUBGWXD1ghlM23pVSOlM4= sha256:EPy8scAcArcPo8hsDP0t7E3FQBjLsFllPHk6jv4QObE= sha1:C8r1SunCmy1lY02ru4OQaLiT/vQ= sha256:F/m4BRXjUGLYGIlOj4wtoyl006sJ/xVTQ2Lp3+qU0k8=