Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changes to metastrings and metacharacters

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language
View previous topic :: View next topic  
Author Message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Jul 25th, 2015, 6:13am    Post subject: Changes to metastrings and metacharacters Reply with quote

Hi all,

I'm in the process of re-evaluating the choices of metastrings—the names for commonly-used strings that can differ by platform or are difficult for some people to remember. Below is a partial reproduction of the Metacharacters and Metastrings article.

I'd like to know your opinions on my choices and whether you would like to see anything changed or added to what I have now.

Constant metastrings
MetastringMeaningEquivalents
$L or $LFLine feed$10 $HA $O12 $B1010
$N or $NLNewline(Platform-dependent)
$R or $CRCarriage return$13 $HD $O15 $B1101
$T or $TABHorizontal tab$9 $H9 $O11 $B1001

Magic metastrings
Certain metastrings have values that change depending on factors such as where you place them. The following table summarizes these "magic" metastrings.
MetastringMeaning
$DATEThe date during compilation in UTC
$FILEThe name of the source file
$LINEThe line number within the source file
$OWNERThe name of the class, object, trait, or module
$PROCThe name of the procedure
$TIMEThe time during compilation in UTC


Changed the subject

_________________
Brent


Last edited by Brent on Jul 26th, 2015, 5:39am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
STPendl
Full Member


Joined: 20 Aug 2007
Posts: 161
Location: Austria

PostPosted: Jul 25th, 2015, 9:08am    Post subject: Re: Changes to metastrings Reply with quote

Brent wrote:

Constant metastrings
MetastringMeaningEquivalents
$L or $LFLine feed$10 $HA $O12 $B1010
$N or $NLNewline(Platform-dependent)
$R or $CRCarriage return$13 $HD $O15 $B1101
$T or $TABHorizontal tab$9 $H9 $O11 $B1001



I would go for the mnemonics, the single character option might result in requests to change it to a different one.
Sure they provide a way to faster convert from C to ViviFire, but are there really two ways needed to specify the same thing?

_________________
Stefan

Any code I post can be freely used, just give credit.
Back to top
View user's profile Send private message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Jul 26th, 2015, 5:24am    Post subject: Re: Changes to metastrings and metacharacters Reply with quote

Stefan, technically there are at least four ways to specify any one-character string, as can be seen under the "Equivalents" column of my table. The mnemonics would add a fifth or sixth.

As I was writing this, it occurred to me that the article I linked to above misuses the term "metacharacter". Metacharacters in VF have a parallel construction to mnemonic metastrings. For example, `Cr` would represent the value 13. Single characters such as `C` and `r` would have the values 67 and 114, respectively.

Now I need to rewrite the first part of the article and come up with a term to describe those features of a string literal.

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
STPendl
Full Member


Joined: 20 Aug 2007
Posts: 161
Location: Austria

PostPosted: Jul 26th, 2015, 5:53pm    Post subject: Re: Changes to metastrings and metacharacters Reply with quote

Sorry for being unclear, I was referring to the metastring column Sad

I would not add another equivalent Wink

_________________
Stefan

Any code I post can be freely used, just give credit.
Back to top
View user's profile Send private message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Jul 27th, 2015, 3:29am    Post subject: Re: Changes to metastrings and metacharacters Reply with quote

So, my thinking now is to keep most mnemonic metastrings as two or more letters. Newline will be $N because it's special.

I'm also seriously thinking of changing the metacharacter syntax from `A` or `Cr` to %A and %Cr, respectively. My thinking here is that $ represents a string whether it is placed before (metastring) or after (string variable). Since % already represents integer variables, it could be used in the same way a metastring uses $.

The only con to using % I can see would be when used with a space. The current form lets you say ` ` while the proposed form would ignore any whitespace character. Though I suppose I could make it that a solitary % implies the space character.

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
STPendl
Full Member


Joined: 20 Aug 2007
Posts: 161
Location: Austria

PostPosted: Jul 27th, 2015, 9:24pm    Post subject: Re: Changes to metastrings and metacharacters Reply with quote

Why would one need two characters for a space?
_________________
Stefan

Any code I post can be freely used, just give credit.
Back to top
View user's profile Send private message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Jul 28th, 2015, 5:47am    Post subject: Re: Changes to metastrings and metacharacters Reply with quote

Stefan, the parser ignores whitespace characters between tokens, as is usual for most modern programming languages. This means that a token can neither begin nor end with a whitespace character.

However, I'm having second thoughts about using % as I have previously described. It just isn't giving me a good feeling. So, I'll probably be returning to the backtick.

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language All times are GMT
Page 1 of 1
Jump to:  
Quick Reply
Username:
Message:
   Shortcut keys: Alt+Q to activate, Alt+P to preview, Alt+S to submit
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group