Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

21 May, 2024: Computers section is temporarily disabled for maintenance. It will take several days before it's back.


devel / comp.lang.prolog / Re: Bringing Unicode to Prolog (Dogelog Runtime)

SubjectAuthor
* Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
+* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|`* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
| `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|  `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|   `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|    `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|     `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|      `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|       `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|        `- Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
+* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|`* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
| `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|  `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|   `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|    `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|     `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|      `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|       `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|        `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|         +* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|         |`- Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|         `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|          `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|           `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|            `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|             `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|              `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|               `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|                `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|                 `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|                  `* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|                   +- Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|                   +- Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|                   `- Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
+* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
|`- Re: Bringing Unicode to Prolog (Dogelog Runtime)Mostowski Collapse
`* Re: Bringing Unicode to Prolog (Dogelog Runtime)Mild Shock
 `- Re: Bringing Unicode to Prolog (Dogelog Runtime)Mild Shock

Pages:12
Re: Bringing Unicode to Prolog (Dogelog Runtime)

<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=766&group=comp.lang.prolog#766

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:fbd1:: with SMTP id n17mr4843107qvp.19.1627559268775;
Thu, 29 Jul 2021 04:47:48 -0700 (PDT)
X-Received: by 2002:a25:3b05:: with SMTP id i5mr6349440yba.109.1627559268563;
Thu, 29 Jul 2021 04:47:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 29 Jul 2021 04:47:48 -0700 (PDT)
In-Reply-To: <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 29 Jul 2021 11:47:48 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Thu, 29 Jul 2021 11:47 UTC

But I guess it would be legit to show it automatically
in scientific form, since there is no ambiguity in re-read
when shown as follows (Dogelog runtime output):

:- X is 30000000000000000000000000+0.0, write(X), nl.
3.0E25

Yes, such an output would also work in Picat:

Picat> X is 3.0E25.
X = 30000000000000000570425344.0
yes

Its the same float.

Mostowski Collapse schrieb am Donnerstag, 29. Juli 2021 um 13:46:31 UTC+2:
> I just tried:
>
> Picat 3.1, (C) picat-lang.org, 2013-2021.
> Picat> X is float(30000000000000000000000000).
> *** Undefined procedure: float/1
>
> So float/1 doesn't exist. What am I supposed to do?
> This here seems to be a work around though?
>
> Picat> X is 30000000000000000000000000+0.0.
> X = 30000000000000000570425344.0
> yes
>
> It is even correct! (Tested on Mac)

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=767&group=comp.lang.prolog#767

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:540f:: with SMTP id b15mr3914185qtq.193.1627559803645;
Thu, 29 Jul 2021 04:56:43 -0700 (PDT)
X-Received: by 2002:a25:c712:: with SMTP id w18mr6240780ybe.390.1627559803499;
Thu, 29 Jul 2021 04:56:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 29 Jul 2021 04:56:43 -0700 (PDT)
In-Reply-To: <0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 29 Jul 2021 11:56:43 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Thu, 29 Jul 2021 11:56 UTC

TauProlog 0.3.1 (beta)

?- number_chars(X,"30000000000000000000000000").
X = 3.
?- X is 30000000000000000000000000.
X = 3.

Was rather expecting an overflow error, because of the flag value:

?- current_prolog_flag(bounded, X).
X = true

Mostowski Collapse schrieb am Donnerstag, 29. Juli 2021 um 13:47:49 UTC+2:
> But I guess it would be legit to show it automatically
> in scientific form, since there is no ambiguity in re-read
> when shown as follows (Dogelog runtime output):
>
> :- X is 30000000000000000000000000+0.0, write(X), nl.
> 3.0E25
>
> Yes, such an output would also work in Picat:
>
> Picat> X is 3.0E25.
> X = 30000000000000000570425344.0
> yes
>
> Its the same float.
> Mostowski Collapse schrieb am Donnerstag, 29. Juli 2021 um 13:46:31 UTC+2:
> > I just tried:
> >
> > Picat 3.1, (C) picat-lang.org, 2013-2021.
> > Picat> X is float(30000000000000000000000000).
> > *** Undefined procedure: float/1
> >
> > So float/1 doesn't exist. What am I supposed to do?
> > This here seems to be a work around though?
> >
> > Picat> X is 30000000000000000000000000+0.0.
> > X = 30000000000000000570425344.0
> > yes
> >
> > It is even correct! (Tested on Mac)

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=768&group=comp.lang.prolog#768

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:74c:: with SMTP id 73mr4792755qkh.104.1627560882319;
Thu, 29 Jul 2021 05:14:42 -0700 (PDT)
X-Received: by 2002:a05:6902:1144:: with SMTP id p4mr6288318ybu.418.1627560882137;
Thu, 29 Jul 2021 05:14:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 29 Jul 2021 05:14:41 -0700 (PDT)
In-Reply-To: <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 29 Jul 2021 12:14:42 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Thu, 29 Jul 2021 12:14 UTC

Even Python disagrees:

/* Python: https://www.python.org/shell/ */
>>> int(float(30000000000000000000000000))
30000000000000000570425344

/* SWI-Prolog: https://swish.swi-prolog.org/ */
?- X is integer(float(30000000000000000000000000)).
X = 29999999999999996275458048

Mostowski Collapse schrieb am Donnerstag, 29. Juli 2021 um 13:56:44 UTC+2:
> TauProlog 0.3.1 (beta)
>
> ?- number_chars(X,"30000000000000000000000000").
> X = 3.
> ?- X is 30000000000000000000000000.
> X = 3.
>
> Was rather expecting an overflow error, because of the flag value:
>
> ?- current_prolog_flag(bounded, X).
> X = true
> Mostowski Collapse schrieb am Donnerstag, 29. Juli 2021 um 13:47:49 UTC+2:
> > But I guess it would be legit to show it automatically
> > in scientific form, since there is no ambiguity in re-read
> > when shown as follows (Dogelog runtime output):
> >
> > :- X is 30000000000000000000000000+0.0, write(X), nl.
> > 3.0E25
> >
> > Yes, such an output would also work in Picat:
> >
> > Picat> X is 3.0E25.
> > X = 30000000000000000570425344.0
> > yes
> >
> > Its the same float.
> > Mostowski Collapse schrieb am Donnerstag, 29. Juli 2021 um 13:46:31 UTC+2:
> > > I just tried:
> > >
> > > Picat 3.1, (C) picat-lang.org, 2013-2021.
> > > Picat> X is float(30000000000000000000000000).
> > > *** Undefined procedure: float/1
> > >
> > > So float/1 doesn't exist. What am I supposed to do?
> > > This here seems to be a work around though?
> > >
> > > Picat> X is 30000000000000000000000000+0.0.
> > > X = 30000000000000000570425344.0
> > > yes
> > >
> > > It is even correct! (Tested on Mac)

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=769&group=comp.lang.prolog#769

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:14b7:: with SMTP id x23mr6767452qkj.387.1627584755022;
Thu, 29 Jul 2021 11:52:35 -0700 (PDT)
X-Received: by 2002:a25:aaa4:: with SMTP id t33mr8528423ybi.256.1627584754836;
Thu, 29 Jul 2021 11:52:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 29 Jul 2021 11:52:34 -0700 (PDT)
In-Reply-To: <3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 29 Jul 2021 18:52:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Thu, 29 Jul 2021 18:52 UTC

Maybe I should do more testing, JavaScript describes the method to find a
float as HALFEVEN. I guess this method applied when one calls the conversion
Number(), i.e. the constructor without the new keyword, which is the float/1 evaluable
function equivalent of JavaScript. The conversion Number() can be also
called for bigint arguments. So JavaScript has float/1 from a bigint like
Prolog does have. So how is this conversion described:

" In this specification, the phrase “the Number value for x” where x
represents an exact real mathematical quantity (which might even be
an irrational number such as π) means a Number value chosen in the
following manner. Consider the set of all finite values of the Number type,
with -0𝔽 removed and with two additional values added to it that are not
representable in the Number type, namely 2^1024 (which is +1 × 253 × 2971)
and -2^1024 (which is -1 × 253 × 2971). Choose the member of this set that
is closest in value to x. If two values of the set are equally close, then the
one with an even significand is chosen; for this purpose, the two extra values
2^1024 and -2^1024 are considered to have even significands. Finally, if 2^1024
was chosen, replace it with +∞𝔽; if -21024 was chosen, replace it with -∞𝔽;
if +0𝔽 was chosen, replace it with -0𝔽 if and only if x < 0; any other chosen
value is used unchanged. The result is the Number value for x. (This procedure
corresponds exactly to the behaviour of the IEEE 754-2019 roundTiesToEven mode.)"
https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type

I am not sure whether I tested this already. The current test doesn’t test a tie.
Creating a tie test case is a tick more work. Also the above describes a
choice of negative zero. I should convert negative zero into positive zero
in my system, since I do not want to support that, its currently not in the
ISO core standard. But SWI-Prolog might support it:

/* SWI-Prolog 8.3.26 */
?- X is -0.0.
X = -0.0.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=770&group=comp.lang.prolog#770

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:9ec1:: with SMTP id h184mr6742347qke.0.1627584854821;
Thu, 29 Jul 2021 11:54:14 -0700 (PDT)
X-Received: by 2002:a25:541:: with SMTP id 62mr8071172ybf.367.1627584854619;
Thu, 29 Jul 2021 11:54:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 29 Jul 2021 11:54:14 -0700 (PDT)
In-Reply-To: <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com> <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 29 Jul 2021 18:54:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Thu, 29 Jul 2021 18:54 UTC

Ok there is no danger of negative zero, since a funny side effect
of mapping small floats to bigint. I have to do that otherwise I cannot
distinguish them from small int, and small float and small int would
both have the same type. Currently result is (Dogelog runtime):

:- X is -1.0*0.0, write(X), nl.
:- 0.0 == -0.0, write(yes), nl; write(no), nl.
0.0
yes

Mostowski Collapse schrieb am Donnerstag, 29. Juli 2021 um 20:52:35 UTC+2:
> Maybe I should do more testing, JavaScript describes the method to find a
> float as HALFEVEN. I guess this method applied when one calls the conversion
> Number(), i.e. the constructor without the new keyword, which is the float/1 evaluable
> function equivalent of JavaScript. The conversion Number() can be also
> called for bigint arguments. So JavaScript has float/1 from a bigint like
> Prolog does have. So how is this conversion described:
>
> " In this specification, the phrase “the Number value for x” where x
> represents an exact real mathematical quantity (which might even be
> an irrational number such as π) means a Number value chosen in the
> following manner. Consider the set of all finite values of the Number type,
> with -0𝔽 removed and with two additional values added to it that are not
> representable in the Number type, namely 2^1024 (which is +1 × 253 × 2971)
> and -2^1024 (which is -1 × 253 × 2971). Choose the member of this set that
> is closest in value to x. If two values of the set are equally close, then the
> one with an even significand is chosen; for this purpose, the two extra values
> 2^1024 and -2^1024 are considered to have even significands. Finally, if 2^1024
> was chosen, replace it with +∞𝔽; if -21024 was chosen, replace it with -∞𝔽;
> if +0𝔽 was chosen, replace it with -0𝔽 if and only if x < 0; any other chosen
> value is used unchanged. The result is the Number value for x. (This procedure
> corresponds exactly to the behaviour of the IEEE 754-2019 roundTiesToEven mode.)"
> https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type
>
> I am not sure whether I tested this already. The current test doesn’t test a tie.
> Creating a tie test case is a tick more work. Also the above describes a
> choice of negative zero. I should convert negative zero into positive zero
> in my system, since I do not want to support that, its currently not in the
> ISO core standard. But SWI-Prolog might support it:
>
> /* SWI-Prolog 8.3.26 */
> ?- X is -0.0.
> X = -0.0.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=771&group=comp.lang.prolog#771

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1304:: with SMTP id o4mr2520731qkj.366.1627653088143;
Fri, 30 Jul 2021 06:51:28 -0700 (PDT)
X-Received: by 2002:a25:541:: with SMTP id 62mr3124014ybf.367.1627653087946;
Fri, 30 Jul 2021 06:51:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 30 Jul 2021 06:51:27 -0700 (PDT)
In-Reply-To: <2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com> <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
<2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 30 Jul 2021 13:51:28 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Fri, 30 Jul 2021 13:51 UTC

Oho, Scryer Prolog (v0.8.127) isn't that lucky either. I get:

?- X is float(30000000000000000000000000).
X = 29999999999999996000000000.0.
?- 30000000000000000000000000 < 30000000000000000000000000.1.
true.

Expectation would be rather a different float number,
and subsequently the comparison false.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<487eb60e-b132-4bcd-b61a-4603392d73ffn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1549&group=comp.lang.prolog#1549

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:adf:dc91:0:b0:21b:89bc:9d5c with SMTP id r17-20020adfdc91000000b0021b89bc9d5cmr12081822wrj.159.1656059085405;
Fri, 24 Jun 2022 01:24:45 -0700 (PDT)
X-Received: by 2002:a25:230d:0:b0:66c:42b3:7e5 with SMTP id
j13-20020a25230d000000b0066c42b307e5mr1009526ybj.316.1656059084709; Fri, 24
Jun 2022 01:24:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 24 Jun 2022 01:24:44 -0700 (PDT)
In-Reply-To: <665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com> <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
<2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com> <665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <487eb60e-b132-4bcd-b61a-4603392d73ffn@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 24 Jun 2022 08:24:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Fri, 24 Jun 2022 08:24 UTC

Now there are some interesting news, we might soon
see SWI-Prolog performing the following feat:

?- A = ४२.
A = 42.

This works already for a while in Dogelog, although
it had a bug, which was only fixed yesterday.

You can try:
http://www.xlog.ch/izytab/moblet/docs/18_live/10_reference/example01/package.html

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<e7d5a998-ed55-424c-a73c-020299633dban@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1550&group=comp.lang.prolog#1550

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:600c:4f84:b0:39c:9897:5295 with SMTP id n4-20020a05600c4f8400b0039c98975295mr2486397wmq.158.1656059532083;
Fri, 24 Jun 2022 01:32:12 -0700 (PDT)
X-Received: by 2002:a0d:df8b:0:b0:318:3f2c:784c with SMTP id
i133-20020a0ddf8b000000b003183f2c784cmr15051641ywe.38.1656059531536; Fri, 24
Jun 2022 01:32:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 24 Jun 2022 01:32:11 -0700 (PDT)
In-Reply-To: <487eb60e-b132-4bcd-b61a-4603392d73ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com> <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
<2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com> <665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>
<487eb60e-b132-4bcd-b61a-4603392d73ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e7d5a998-ed55-424c-a73c-020299633dban@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 24 Jun 2022 08:32:12 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Fri, 24 Jun 2022 08:32 UTC

One could further extend it to Hex. Like for example:

?- A = 0xBABE.
A = 47806.

Works in Dogelog Player and formerly Jekejeke Prolog.
Again I only did it because Java can already do it.

Take this Java code:

int val = Integer.parseInt("BABE", 16);
System.out.println("val="+val);

It gives me:

val=47806

Mostowski Collapse schrieb am Freitag, 24. Juni 2022 um 10:24:47 UTC+2:
> Now there are some interesting news, we might soon
> see SWI-Prolog performing the following feat:
>
> ?- A = ४२.
> A = 42.
>
> This works already for a while in Dogelog, although
> it had a bug, which was only fixed yesterday.
>
> You can try:
> http://www.xlog.ch/izytab/moblet/docs/18_live/10_reference/example01/package.html

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<974c60c2-a185-4c71-bba4-78d038aa67ffn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1551&group=comp.lang.prolog#1551

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a5d:44ca:0:b0:21b:8998:43e7 with SMTP id z10-20020a5d44ca000000b0021b899843e7mr12550113wrr.613.1656063069367;
Fri, 24 Jun 2022 02:31:09 -0700 (PDT)
X-Received: by 2002:a81:600a:0:b0:318:81bc:e928 with SMTP id
u10-20020a81600a000000b0031881bce928mr6259096ywb.119.1656063068734; Fri, 24
Jun 2022 02:31:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 24 Jun 2022 02:31:08 -0700 (PDT)
In-Reply-To: <e7d5a998-ed55-424c-a73c-020299633dban@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com> <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
<2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com> <665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>
<487eb60e-b132-4bcd-b61a-4603392d73ffn@googlegroups.com> <e7d5a998-ed55-424c-a73c-020299633dban@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <974c60c2-a185-4c71-bba4-78d038aa67ffn@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 24 Jun 2022 09:31:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Fri, 24 Jun 2022 09:31 UTC

I could also imagine that this feature is banned from
consulting Prolog texts or reading Prolog terms, and
only works for number_codes/2. But somehow there is

a conflict in the ISO Prolog core standard, number_codes/2
refers to the Prolog text syntax. In Java the feature is also
banned from Java texts. This here doesn’t compile:

int val = 0xBABE;
System.out.println("val="+val);

I get this Java compiler error:

java: illegal non-ASCII digit

So its only Integer.parseInt() thingy and not a Java texts
thingy. But I don’t see for number_codes/2 that the ISO
Prolog core standard would be aware of such a difference.

So at the moment its easier to make a solution that conflates
the two, Prolog texts and some built-ins like number_codes/2.

Mostowski Collapse schrieb am Freitag, 24. Juni 2022 um 10:32:13 UTC+2:
> One could further extend it to Hex. Like for example:
>
> ?- A = 0xBABE.
> A = 47806.
>
> Works in Dogelog Player and formerly Jekejeke Prolog.
> Again I only did it because Java can already do it.
>
> Take this Java code:
>
> int val = Integer.parseInt("BABE", 16);
> System.out.println("val="+val);
>
> It gives me:
>
> val=47806
> Mostowski Collapse schrieb am Freitag, 24. Juni 2022 um 10:24:47 UTC+2:
> > Now there are some interesting news, we might soon
> > see SWI-Prolog performing the following feat:
> >
> > ?- A = ४२.
> > A = 42.
> >
> > This works already for a while in Dogelog, although
> > it had a bug, which was only fixed yesterday.
> >
> > You can try:
> > http://www.xlog.ch/izytab/moblet/docs/18_live/10_reference/example01/package.html

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<2849dffd-eb64-454f-9295-81b39b54ab5bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1552&group=comp.lang.prolog#1552

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:adf:e196:0:b0:219:f3c7:fd88 with SMTP id az22-20020adfe196000000b00219f3c7fd88mr2951930wrb.402.1656148919351;
Sat, 25 Jun 2022 02:21:59 -0700 (PDT)
X-Received: by 2002:a81:100d:0:b0:317:a2a8:833d with SMTP id
13-20020a81100d000000b00317a2a8833dmr3522133ywq.69.1656148918654; Sat, 25 Jun
2022 02:21:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 25 Jun 2022 02:21:58 -0700 (PDT)
In-Reply-To: <974c60c2-a185-4c71-bba4-78d038aa67ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com> <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
<2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com> <665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>
<487eb60e-b132-4bcd-b61a-4603392d73ffn@googlegroups.com> <e7d5a998-ed55-424c-a73c-020299633dban@googlegroups.com>
<974c60c2-a185-4c71-bba4-78d038aa67ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2849dffd-eb64-454f-9295-81b39b54ab5bn@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 25 Jun 2022 09:21:59 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Sat, 25 Jun 2022 09:21 UTC

Now I am picking up new vibes for Dogelog Player, its still
a young Prolog system, and the streams are also still pretty
primitive. Maybe some new ideas might even spill back

to formerly Jekejeke Prolog. So whats on the todo list next?
I find that the following goodies concerning open/4 are missing,
its even the case that we even only have an open/3 so far:

- bom(Bool)
Specify detecting or writing a BOM.
- encoding(Atom)
Specify a file encoding.

BTW: This is an interesting read:

> Microsoft compilers and interpreters, and many pieces of software
> on Microsoft Windows such as Notepad treat the BOM as a required
> magic number rather than use heuristics. These tools add a BOM when
> saving text as UTF-8, and cannot interpret UTF-8 unless the BOM is
> present or the file contains only ASCII.
> https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8

So you might find a BOM also for UTF-8 files, not only UTF-16 and other
encodings. The usual heuristic is to choose UTF-8 if there is no BOM, but
the above suggests to throw an error if there is no BOM

and some non-ASCII, i.e. > 7 bit.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<fee82adf-edf8-41c0-9cb8-1c4b95c75d57n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1553&group=comp.lang.prolog#1553

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6000:993:b0:21b:8f16:5b3f with SMTP id by19-20020a056000099300b0021b8f165b3fmr2913226wrb.628.1656149169675;
Sat, 25 Jun 2022 02:26:09 -0700 (PDT)
X-Received: by 2002:a81:d16:0:b0:317:c015:571b with SMTP id
22-20020a810d16000000b00317c015571bmr3447903ywn.263.1656149169078; Sat, 25
Jun 2022 02:26:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 25 Jun 2022 02:26:08 -0700 (PDT)
In-Reply-To: <2849dffd-eb64-454f-9295-81b39b54ab5bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <scd8ii$2qa$1@solani.org> <sdeegg$1es$1@solani.org>
<2e81cf8f-08b1-46f2-8c6c-e1d2fa12ca43n@googlegroups.com> <07945131-ede4-460e-ab3a-7f63065a2357n@googlegroups.com>
<9762917c-04f3-4764-9170-9300ecc5c5ecn@googlegroups.com> <sdi1iq$1l7$1@solani.org>
<sdi1sa$1td$1@solani.org> <sdi1ur$1td$2@solani.org> <sdi2q0$2i3$1@solani.org>
<b9e425a1-a0e4-443c-ad3d-a2803c80b4c9n@googlegroups.com> <664516ce-f177-4b4e-a3f7-5576e78a740bn@googlegroups.com>
<7fccd2d2-db53-4827-a8c7-a32e6ac302dcn@googlegroups.com> <59d6d83a-a0bd-4d42-bab7-8707a1c24b4fn@googlegroups.com>
<0b5e3fba-ee36-4dd3-8bec-f44c1bb038dbn@googlegroups.com> <d70e7ef2-278f-494c-b96b-d5bc79b2cbebn@googlegroups.com>
<3055f434-f14c-48df-ae8e-babaf89e035bn@googlegroups.com> <71c322d9-2baa-4d48-bfab-295e4e80598dn@googlegroups.com>
<2764d5e3-5a36-4c7e-a9b4-1832c806230en@googlegroups.com> <665663d7-6651-4362-a993-12c0c7a4cda1n@googlegroups.com>
<487eb60e-b132-4bcd-b61a-4603392d73ffn@googlegroups.com> <e7d5a998-ed55-424c-a73c-020299633dban@googlegroups.com>
<974c60c2-a185-4c71-bba4-78d038aa67ffn@googlegroups.com> <2849dffd-eb64-454f-9295-81b39b54ab5bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fee82adf-edf8-41c0-9cb8-1c4b95c75d57n@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 25 Jun 2022 09:26:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Sat, 25 Jun 2022 09:26 UTC

Don’t know if any Prolog system throws such an error. One could
make the input stream aware that there was no BOM, and then bark
on a > 7 bit character coming from the stream. Could give more security.

Makes me currious to check what Java, JavaScript and Python do,
whether they have some reader object with such a feature. In the
worst case one could realize this feature in the Prolog systems

streams itself. Again bom(Bool) is not mentioned in the ISO Prolog
core standard, similar to encoding(Atom), but it has already some
support across Prolog systems. For example in formerly Jekejeke

Prolog I have the same, and SWI-Prolog has it as well. Not sure
what newer Prolog systems such as Scryer Prolog provide.
Need to check.

Mostowski Collapse schrieb am Samstag, 25. Juni 2022 um 11:22:01 UTC+2:
> Now I am picking up new vibes for Dogelog Player, its still
> a young Prolog system, and the streams are also still pretty
> primitive. Maybe some new ideas might even spill back
>
> to formerly Jekejeke Prolog. So whats on the todo list next?
> I find that the following goodies concerning open/4 are missing,
> its even the case that we even only have an open/3 so far:
>
> - bom(Bool)
> Specify detecting or writing a BOM.
> - encoding(Atom)
> Specify a file encoding.
>
> BTW: This is an interesting read:
>
> > Microsoft compilers and interpreters, and many pieces of software
> > on Microsoft Windows such as Notepad treat the BOM as a required
> > magic number rather than use heuristics. These tools add a BOM when
> > saving text as UTF-8, and cannot interpret UTF-8 unless the BOM is
> > present or the file contains only ASCII.
> > https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
>
> So you might find a BOM also for UTF-8 files, not only UTF-16 and other
> encodings. The usual heuristic is to choose UTF-8 if there is no BOM, but
> the above suggests to throw an error if there is no BOM
>
> and some non-ASCII, i.e. > 7 bit.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<e91e1792-73bb-4cfe-8632-5d5d82933b95n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1921&group=comp.lang.prolog#1921

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1981:b0:3b8:1f2c:f5cf with SMTP id u1-20020a05622a198100b003b81f2cf5cfmr805350qtc.147.1675095451296;
Mon, 30 Jan 2023 08:17:31 -0800 (PST)
X-Received: by 2002:aca:590b:0:b0:364:42a0:a0b6 with SMTP id
n11-20020aca590b000000b0036442a0a0b6mr2248260oib.136.1675095451059; Mon, 30
Jan 2023 08:17:31 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 30 Jan 2023 08:17:30 -0800 (PST)
In-Reply-To: <scd8ii$2qa$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <scd8ii$2qa$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e91e1792-73bb-4cfe-8632-5d5d82933b95n@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 30 Jan 2023 16:17:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1437
 by: Mostowski Collapse - Mon, 30 Jan 2023 16:17 UTC

Q: Why did Prolog miss the OpenAI/ChatGPT bandwagon?

A: Its in the genetics, Prolog is developing backwards:

1) Quintus: library(charsio)

2) SICStus: Na, library(codesio), characters that are atoms
of length 1 could pollute the atom table.

3.1) Scryer Prolog: Na, library(charsio), we have to go backwards,
create a vintage Prolog.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<0de00151-f9f7-4d85-a28b-257ad1ef9472n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1922&group=comp.lang.prolog#1922

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:4389:b0:3a5:46b0:ffec with SMTP id em9-20020a05622a438900b003a546b0ffecmr2581141qtb.306.1675095535556;
Mon, 30 Jan 2023 08:18:55 -0800 (PST)
X-Received: by 2002:a05:6808:228a:b0:378:76f1:522d with SMTP id
bo10-20020a056808228a00b0037876f1522dmr104568oib.68.1675095535239; Mon, 30
Jan 2023 08:18:55 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 30 Jan 2023 08:18:54 -0800 (PST)
In-Reply-To: <e91e1792-73bb-4cfe-8632-5d5d82933b95n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <scd8ii$2qa$1@solani.org> <e91e1792-73bb-4cfe-8632-5d5d82933b95n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0de00151-f9f7-4d85-a28b-257ad1ef9472n@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 30 Jan 2023 16:18:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1816
 by: Mostowski Collapse - Mon, 30 Jan 2023 16:18 UTC

Meanwhile I am seriously considering renaming my
library(charsio) into library(atomsio), since that is
more what it does.

3.2) Dogelog Player: Na, library(atomsio),
what atom table?

Mostowski Collapse schrieb am Montag, 30. Januar 2023 um 17:17:32 UTC+1:
> Q: Why did Prolog miss the OpenAI/ChatGPT bandwagon?
>
> A: Its in the genetics, Prolog is developing backwards:
>
> 1) Quintus: library(charsio)
>
> 2) SICStus: Na, library(codesio), characters that are atoms
> of length 1 could pollute the atom table.
>
> 3.1) Scryer Prolog: Na, library(charsio), we have to go backwards,
> create a vintage Prolog.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2096&group=comp.lang.prolog#2096

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7d96:0:b0:40e:b4f2:b38e with SMTP id c22-20020ac87d96000000b0040eb4f2b38emr10596qtd.2.1690790447235;
Mon, 31 Jul 2023 01:00:47 -0700 (PDT)
X-Received: by 2002:a4a:370f:0:b0:56c:85cc:b378 with SMTP id
r15-20020a4a370f000000b0056c85ccb378mr6223146oor.1.1690790446858; Mon, 31 Jul
2023 01:00:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 31 Jul 2023 01:00:46 -0700 (PDT)
In-Reply-To: <7a9e3b0d-0929-45e3-b7d2-318d9bd1f069n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <scd8ii$2qa$1@solani.org> <4ca4a4d0-d91a-45b4-81b3-0bc46818f141n@googlegroups.com>
<7a9e3b0d-0929-45e3-b7d2-318d9bd1f069n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Mon, 31 Jul 2023 08:00:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2310
 by: Mild Shock - Mon, 31 Jul 2023 08:00 UTC

Note: Do not confuse multillingual strings, as introduced
by recent Dogelog Player, with Unicode encoding.
I am using the phrase "multilingual strings" for a text

database. Interestingly I managed to make the text
database declarative. Means the strings/3 entries
are not order dependent. You can place languages into
the multifile predicate in any order,

and it will pick the most specific string independent
of the order of the strings/3 facts. I was replicating
the Java Script Resource Bundle lookup on a finer
grained level, by this simple Prolog code:

get_string(Key, Locale, Value) :-
sys_locale_ancestor(Locale, Parent),
strings(Key, Parent, Res), !,
Value = Res.

% sys_locale_ancestor(+Atom, -Atom)
sys_locale_ancestor(L, L).
sys_locale_ancestor(L, M) :-
last_sub_atom(L, P, _, _, '_'),
sub_atom(L, 0, P, _, M).
sys_locale_ancestor(_, '').

The above assumes that locale identifiers use
underscore separator. It also assumes the last_sub_atom/3
predicate from Novacore, unfortunatel ISO Core has
only sub_atom/3, but no last_sub_atom/3.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<ua7q1n$60o$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2097&group=comp.lang.prolog#2097

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.prolog
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
Date: Mon, 31 Jul 2023 10:06:17 +0200
Message-ID: <ua7q1n$60o$1@solani.org>
References: <scd8ii$2qa$1@solani.org>
<4ca4a4d0-d91a-45b4-81b3-0bc46818f141n@googlegroups.com>
<7a9e3b0d-0929-45e3-b7d2-318d9bd1f069n@googlegroups.com>
<09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 31 Jul 2023 08:06:15 -0000 (UTC)
Injection-Info: solani.org;
logging-data="6168"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17
Cancel-Lock: sha1:M/e+/Ks6eiQqwjbWxiH4Ab3vMjM=
In-Reply-To: <09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>
X-User-ID: eJwFwYEBgDAIA7CXJi1FzgFh/59g4tCjLygX/frlM5bhtjXN6aYnymlnotGbruAcnO7TCu07ABZZFqRqfkwZFSg=
 by: Mild Shock - Mon, 31 Jul 2023 08:06 UTC

For locales, see also:

Creating global software: Text handling and localization
in Taligent’s CommonPoint application system
Mark Davis et al. - 1996
https://dev.antiguru.de/davis.pdf

I wasn't sure whether the get_string/3 implementation
will perform. In Jekejeke Prolog, since it has
multi-argument indexing, each string/3 lookup with

mode (+,+,-) will be a little bit faster, whereas
Doglog Player, which has only first argument indexing
will use a little bit more time, since it needs

a scan, can only lookup the Key via an index,
but will scan for the Parent. If the text database
isn't extremly large and/or if the locales do

not have extremly many segments, this is a
non-issue I guess. And Dogelog Player might get
multi-argument indexing in the future.

Mild Shock schrieb:
> Note: Do not confuse multillingual strings, as introduced
> by recent Dogelog Player, with Unicode encoding.
> I am using the phrase "multilingual strings" for a text
>
> database. Interestingly I managed to make the text
> database declarative. Means the strings/3 entries
> are not order dependent. You can place languages into
> the multifile predicate in any order,
>
> and it will pick the most specific string independent
> of the order of the strings/3 facts. I was replicating
> the Java Script Resource Bundle lookup on a finer
> grained level, by this simple Prolog code:
>
> get_string(Key, Locale, Value) :-
> sys_locale_ancestor(Locale, Parent),
> strings(Key, Parent, Res), !,
> Value = Res.
>
> % sys_locale_ancestor(+Atom, -Atom)
> sys_locale_ancestor(L, L).
> sys_locale_ancestor(L, M) :-
> last_sub_atom(L, P, _, _, '_'),
> sub_atom(L, 0, P, _, M).
> sys_locale_ancestor(_, '').
>
> The above assumes that locale identifiers use
> underscore separator. It also assumes the last_sub_atom/3
> predicate from Novacore, unfortunatel ISO Core has
> only sub_atom/3, but no last_sub_atom/3.
>


devel / comp.lang.prolog / Re: Bringing Unicode to Prolog (Dogelog Runtime)

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor