Re: [m-users.] Compiler bug found
Volker Wysk <[email protected]>
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
Understood. Thanks for the explanation. Volker Am Freitag, dem 24.02.2023 um 11:41 +1300 schrieb Richard O'Keefe: > Mercury's treatment of variables beginning with underscore > follows Prolog closely. > "_" all by itself is a "wild card" with each occurrence > standing for a different variable. > A variable that does not begin with underscore is expected > to occur at least twice and a 'singleton variable' warning > will be issued if this is not so. > A variable (other than the wild card) that begins with an > underscore is expected to occur exactly once and a warning > will be issued if such a variable is repeated. > > Historically it was important to be able to begin > a variable with an underscore to mark it as a variable > if you were using a terminal with a single case of > letters. Code like > +append(_X, [_X,.._]). > +append(_X, [_,.._L])-append(_X, _L). > was not unusual. To this day, if you are writing in a > script that does not make a case distinction (such as > Chinese or Japanese) you need to be able to prefix a > word in your language with an underscore to make it a > variable WITHOUT turning it into a wildcard. > > > On Fri, 24 Feb 2023 at 07:19, Volker Wysk <[email protected]> wrote: > > Am Freitag, dem 24.02.2023 um 02:15 +1100 schrieb Zoltan Somogyi: > > > A variable token consisting of single underscore is treated specially: > > > each instance of @samp{_} denotes a distinct variable. > > > > > > It does NOT say that *every* variable that starts with an underscore > > denotes > > > a distinct variable. > > > > Hmm... I thought it does. Maybe it's like that in Prolog. > > > > Cheers, > > Volker > > _______________________________________________ > > users mailing list > > [email protected] > > https://lists.mercurylang.org/listinfo/users _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmP4330ACgkQ+K4ydFOs HoVT1xAAzzFaf7bDlJBBUc5nFDNkU51QAMtwspgsjsAJi5DQmnVTAiuxHa33UAfi +auCVp3L6APrgJ3+rCGIA/VAVkup5q2huJAK32NcHIYMlwtJAUNvWkePBJClLSEr O74/kjfYqDzEq2LyIwooSZf0hMjaeVhmDs5aZ2PE3zZBH2Svg/4aXA5K/aJ2xPbW FZ+1Jxl3mG8JQxHDiv3m/Lanx8ioZEecp7efH2Gn1nVBoavp3pMeYRq76qUgm+0j b/IDb/eQePnCJMncht/5gVMc6pgXyErnassN5kuqFa1YWq+T6jRvkyi6+qSamEMQ 6mpp7ocG971Pv0Tf6NnwDQ3lcJGVF0pOjAKn0HKgZ0LEvDoKKMaq2v0+eweDgEID BRaba/lpqHJqqkX9NLv1vuB8awQJs39SY6+SfECx1xm74MbYclwUq4BCnfzDgeK4 DEsFjK2myZukR7c7+Mrds/vSsvYno6ntBtxwikwW/lRE4uDUVB10TOzU2CXtw0Sr 811VOpFDNNVnVcbrU6w27MeMOhHKrpGAr9X3odUJ3ePlcvWKtIguWOnsr024HY0F RWh712+7JM8TEV8wyNSoDIQ4dqZSwRGXf+rc6vUHMlCur5d1vBMaigpPxrn8qcaU WwlWQF3ivsSWMC7cqgEADy01ZBp1886YHACZJFttL3wT/Xd5Ay4= =/pQP -----END PGP SIGNATURE-----