Unicode characters in variable names

Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 216
Joined: 24 Apr 2007 12:26

Unicode characters in variable names

Unread post by Ferenc Nagy » 11 Nov 2013 9:58

Hi,

I keep working on free location, ablolute and relative sizing of the message window.
I inserted the attached figure#~ made of group boxed and static text fields into my form.
The text fields contain arrows and/or Greek letters alpha, beta, gamma and delta.
I defined some of the text fields as fact variables other as simple variables.
I collected the interesting parts of he automatically generated lines in Figure#2.

What characters are in the set of elementsof valid variable, fact variable and constant names, respectively in VIP 7.x versions?


Is the statement shown in Figure#3 valid?
Attachments
unicodevarname.png
Figure#2 Greek letter and other exotic characters in the variable and fact variable names
unicodevarname.png (15.62 KiB) Viewed 2955 times
part of form.png
Figure#1 Part of sizing form
part of form.png (9.76 KiB) Viewed 2961 times
metro.png
Figure#3 Russian characters in Prolog Source code
metro.png (4.58 KiB) Viewed 2961 times
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 12 Nov 2013 21:27

I am not completely sure I understand the question (or why there are so many images attached).

But perhaps this answers the question:

Visual Prolog follows the Unicode standard (as implemented in the Windows operating system) to classify characters as uppercase and lowercase letters.

The advice is as always to use good names. Which in my mind implies using letters you (and those that you share code with) are comfortable with. There is no reward for pushing the system to its boundary.

The easiest way to see if your choice of characters makes sense is by compiling the code: wrong characters will give syntax errors.
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 216
Joined: 24 Apr 2007 12:26

Naming quandaries

Unread post by Ferenc Nagy » 13 Nov 2013 11:42

The advice is as always to use good names. Which in my mind implies using letters you (and those that you share code with) are comfortable with. There is no reward for pushing the system to its boundary.
Which is your practice?
There are contradictory schools of naming.
Do you know San Sieler's article "How to write quality Pascal Programs" http://www.allegro.com/papers/htpp.html?

Before the invention of qualifier like :: in VIP and namespaces the best way to avolid collision of locas names with reserved one was to use Hungarian words without accents.

PHP 5 allowed the using - not yet Unicode - accented characters. I sent the solution of a trial program somewhere using accented Hungarian varable and funcion name. The reviewer refused it: "YOU MUST USE EXCLUSIVELY ENGLISH NAMES!!!"
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 13 Nov 2013 19:07

Visual Prolog is programmed in Russia and Denmark for a global audience. Therefore we stick to English. US-english: "color" rather than "colour", etc. This also implies that we only use a-z.

We more or less follow the principles described in Code Formatting.

We also think a lot about regularity, consistency and patterns. And we regularly discuss which names to use for something: "What name do you think should be used for this?"

No matter which country you come from you will of course have to accept that PFC uses English.

But what you use in your own code is up to you: good native names may be preferable to bad English names.
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 216
Joined: 24 Apr 2007 12:26

Which names to use

Unread post by Ferenc Nagy » 14 Nov 2013 17:38

Hi,
And we regularly discuss which names to use for something: "What name do you think should be used for this?"
Where did you discuss it?

Back to your former question:
I wanted to ember the Russian text in the message body. The text field accepted the Russian characters but the submitted message displayed a HTML-entities: ampersand ladder four digits and semicolon instead of them.


The workaround was the attached sample of the screen made by PicPick (R).

Another technical question:
How can I insert images using the bracket img bracket in my messages?

[/img]
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Re: Which names to use

Unread post by Thomas Linder Puls » 15 Nov 2013 16:27

Ferenc Nagy wrote:
And we regularly discuss which names to use for something: "What name do you think should be used for this?"
Where did you discuss it?
We are my colleguea and me, and we simply talk or write mails.
Ferenc Nagy wrote:Back to your former question:
I wanted to ember the Russian text in the message body. The text field accepted the Russian characters but the submitted message displayed a HTML-entities: ampersand ladder four digits and semicolon instead of them.
Yes, teh forum software cannot handle full Unicode in the code tags, but it handles it fine text: 㣲

Code: Select all

㣲
But I am still not sure what the question is? If it is what I think then it is already answererd in my first reply.
Ferenc Nagy wrote:Another technical question:
How can I insert images using the bracket img bracket in my messages?
The [img] can only be used to link to an image that is somewhere on the Internet: [img]http://image_url[/img]
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 216
Joined: 24 Apr 2007 12:26

Technical question about the text editor of the user interface of this forum

Unread post by Ferenc Nagy » 16 Nov 2013 8:08

Yes, teh forum software cannot handle full Unicode in the code tags, but it handles it fine text: 㣲

㣲

But I am still not sure what the question is? If it is what I think then it is already answererd in my first reply.
Try yourself: enter some words in a language that do uses non-Latin characters using charmap or the languages keyboard and then submit it to the forum.

The editing phase makes you believe that the character go through readable.
The submitted message however contained html-codes as in the above quote.

ישﬡל

I know that this misbehavior is not important in this forum still it would be easier in my first post in this thread to embed the Russian example as plain text instead to attach it.

P. S.

Good news: I saw the inserted Hebrew characters after submitting this re:re:reply.
TIA, Regards,
Frank Nagy

Post Reply