It is currently Wed Jun 19, 2013 3:08 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: any kind of alfanumeric variables
PostPosted: Thu Feb 23, 2012 2:25 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 720
Location: Germany, Glienicke
File -> File-format -> UFT8
compiler -> enable unicode
Debug -> MessageRequester

and i get:
Code:
Define String.s = "ŠTĚPÁNEK ŻEWŁAKOW"

MessageRequester("", String)

Quote:
---------------------------

---------------------------
ŠTĚPÁNEK ŻEWŁAKOW
---------------------------
OK
---------------------------

_________________
Image


Top
 Profile  
 
 Post subject: Re: any kind of alfanumeric variables
PostPosted: Thu Feb 23, 2012 2:35 am 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 1410
Location: Boston, MA
umm, debug output?


Top
 Profile  
 
 Post subject: Re: any kind of alfanumeric variables
PostPosted: Thu Feb 23, 2012 9:51 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4008
Location: Spa, relaxing and thinking, and thinking...
I get
ŠTĚPÁNEK ŻEWŁAKOW

with:
File -> File-format -> plain text
compiler -> DIsable unicode

with debug output and also with MessageRequester

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


for (humanlife=0 ; world==business ; humanlife++)
{
mafia+=world;
}


Top
 Profile  
 
 Post subject: Re: any kind of alfanumeric variables
PostPosted: Thu Feb 23, 2012 8:48 pm 
Offline
Addict
Addict

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 808
Psychophanta wrote:
and now...
the question is:
why not?
(NOTICE: answers like "because every language is not like that" or "because everytime has been like that", etc, are not considered valid, because it is not a valid argue)


The biggest reason "nobody does it that way" is because when we are about 12 years old, we learn that y=4x means y=4*x. To permit a number in the first position of a variable will confuse 100% of the new users. It is not merely a "different way to do things," but it contradicts everything taught about variables and numbers outside of programming--and these practices are centuries old. That's why nobody does it that way; to avoid confusion.

As far as parsing goes, it is trivial to implement it, and has nothing to do with the decision. PB has a super simple parser, so perhaps it only looks at the first character to determine the next token for all numbers (123, $123, #abc, etc.), but many languages allow mixing of numbers and characters (0x123, 0b1001, for instance), and allowing this would be far from complex. The syntax is simple, very easy to implement, and would not require "42" to be a variable if you require that all variable-names contain at least one non-number character. In fact, it would be no more difficult than allowing the underscore in a name.

So, why not? Mostly, to avoid confusion.


Top
 Profile  
 
 Post subject: Re: any kind of alfanumeric variables
PostPosted: Mon Mar 12, 2012 9:16 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Sep 23, 2008 11:38 pm
Posts: 702
Location: Belgium (& Luxembourg)
Clarity would be lost and confusion would be huge, but you can use the underscore symbol :mrgreen:
Code:
_12e4=4
_4t=-7
_42=-2
Debug _12e4*(_4t-_42)+(_12e4+_42)*_4t

_________________
- Future conversation forecasting not yet implemented.
- If the future had copied a program from now, they would have called it version -1.


Top
 Profile  
 
 Post subject: Re: any kind of alfanumeric variables
PostPosted: Tue Mar 13, 2012 11:27 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4008
Location: Spa, relaxing and thinking, and thinking...
charvista wrote:
Clarity would be lost and confusion would be huge, but you can use the underscore symbol :mrgreen:
Code:
_12e4=4
_4t=-7
_42=-2
Debug _12e4*(_4t-_42)+(_12e4+_42)*_4t

Good and simple idea, just useful for me. Thanks!

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


for (humanlife=0 ; world==business ; humanlife++)
{
mafia+=world;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye