Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Dollar sign ($) on foriegn keyboards? (prothon)

Reply
Thread Tools

Dollar sign ($) on foriegn keyboards? (prothon)

 
 
srijit@yahoo.com
Guest
Posts: n/a
 
      04-20-2004
Hello Mark,
IMO typing dollar($) sign should not be a problem in Sweden and Germany.

Regards,
Srijit

"Mark Hahn" <(E-Mail Removed)> wrote in message news:<mk3hc.13895$dZ1.10823@fed1read04>...
> We are considering switching to the dollar sign ($) for self, instead of the
> period ( . ) we are using now in Prothon. Ruby uses the at-sign (@) for
> self, but our new usage of self also includes replacing the period for some
> attribute references, as in obj$func() versus obj.func(), and too many
> programs treat that as an email address and screw it up. Also the S in the
> symbol $ reminds one of the S in $elf.
>
> Can people from outside the U.S. tell me if typing the dollar sign often
> would be a problem in writing code? Is it available and somewhat easy to
> type on international keyboards?

 
Reply With Quote
 
 
 
 
Adriano Varoli Piazza
Guest
Posts: n/a
 
      04-20-2004
El Mar 20 Abr 2004 03:22, Mark Hahn escribió:
> We are considering switching to the dollar sign ($) for self, instead
> of the period ( . ) we are using now in Prothon. Ruby uses the
> at-sign (@) for self, but our new usage of self also includes
> replacing the period for some attribute references, as in obj$func()
> versus obj.func(), and too many programs treat that as an email
> address and screw it up. Also the S in the symbol $ reminds one of
> the S in $elf.
>
> Can people from outside the U.S. tell me if typing the dollar sign
> often would be a problem in writing code? Is it available and
> somewhat easy to type on international keyboards?


Spanish and Latin American QUERTY keyboards: Shift + 4.
--
Adriano Varoli Piazza
The Inside Out: http://moranar.com.ar
ICQ: 4410132
MSN: http://www.velocityreviews.com/forums/(E-Mail Removed)
Claves gpg / pgp en hkp://subkeys.pgp.net

 
Reply With Quote
 
 
 
 
Peter Maas
Guest
Posts: n/a
 
      04-20-2004
Peter Otten wrote:
> In Germany every serious programmer has to switch to the American
> layout anyway because of {}[]@\~| (all odd AltGr combinations).


Oh, I didn't know that. Fortunately I'm not a serious programmer.

Mit freundlichen Gruessen,

Peter Maas

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail (E-Mail Removed)
-------------------------------------------------------------------
 
Reply With Quote
 
Peter Otten
Guest
Posts: n/a
 
      04-20-2004
Peter Maas wrote:

> Peter Otten wrote:
>> In Germany every serious programmer has to switch to the American
> > layout anyway because of {}[]@\~| (all odd AltGr combinations).

>
> Oh, I didn't know that. Fortunately I'm not a serious programmer.


I hate people being apodictic - even myself.
But I never felt comfortable with AltGr, so it was a great relief when I
learned about switching kezboard lazouts and well worth the occasional y-z
glitch. By the way, I once came across a whole book that had these
characters swapped.

Maybe my fingers just didn't grow in the right place to press AltGr+9
simultaneously, but somehow I can't see how that makes me the member of a
minority.

Mit freundlichen Gr[-en

Peter


 
Reply With Quote
 
Fredrik Lundh
Guest
Posts: n/a
 
      04-20-2004
Mark Hahn wrote:¨

> We are considering switching to the dollar sign ($) for self, instead of the
> period ( . ) we are using now in Prothon.


any reason you cannot set up a mailing list for your little pet
project? you're generating tons of off-topic traffic, and frankly,
I don't think I'm the only one who couldn't care less about your
pre-alpha hack with minimum capabilities.

(if I posted hundreds of messages for every pre-alpha hack I've
ever made, people would quickly label me as an annoying crack-
pot.)

</F>




 
Reply With Quote
 
Des Small
Guest
Posts: n/a
 
      04-20-2004
"Mark Hahn" <(E-Mail Removed)> writes:

> Can people from outside the U.S. tell me if typing the dollar sign often
> would be a problem in writing code? Is it available and somewhat easy to
> type on international keyboards?


The dollar sign is used in extensively in Unix shells and Perl, which
are both widely used (Perl also on Windows). It seems unlikely that
any keyboard with a latin alphabet wouldn't include it.

Des
types in a wide variety of dollar-equipped iso encodings.
--
"[T]he structural trend in linguistics which took root with the
International Congresses of the twenties and early thirties [...] had
close and effective connections with phenomenology in its Husserlian
and Hegelian versions." -- Roman Jakobson
 
Reply With Quote
 
Joe Mason
Guest
Posts: n/a
 
      04-20-2004
In article <c631kk$9j9$04$(E-Mail Removed)-online.com>, Peter Otten wrote:
>>> Apart from that obj$func() hurts my eye more than obj->func() and
>>> obj!func(). As always, Python shines here with its obj.func()

>>
>> I believe the suggestion is "$.func()" instead of "self.func()" (the
>> Python way) or just ".func()" (the earlier Prothon way). Or possibly
>> the suggestion is for "$func()", although I like $.func() much better.

>
> I skimmed too lightly over the first paragraph and missed that - but still
> there is the obj$func() example in Mark's post, and with my Python mindset
> (I didn't follow the Prothon discussion closely) I cannot figure out what
> that is supposed to mean.


Oops - I skimmed even more lightly than you did, cause I missed the
obj$func example entirely.

Joe
 
Reply With Quote
 
Joe Mason
Guest
Posts: n/a
 
      04-20-2004
In article <(E-Mail Removed)>, Fredrik Lundh wrote:
> Mark Hahn wrote:¨
>
>> We are considering switching to the dollar sign ($) for self, instead of the
>> period ( . ) we are using now in Prothon.

>
> any reason you cannot set up a mailing list for your little pet
> project? you're generating tons of off-topic traffic, and frankly,
> I don't think I'm the only one who couldn't care less about your
> pre-alpha hack with minimum capabilities.


There is a mailing list, it's got tons of traffic, and I think Mark's
being pretty judicious in what he posts here.

Joe
 
Reply With Quote
 
Mark Hahn
Guest
Posts: n/a
 
      04-20-2004
"Fredrik Lundh" <(E-Mail Removed)> wrote ...

> any reason you cannot set up a mailing list for your little pet
> project? you're generating tons of off-topic traffic, and frankly,
> I don't think I'm the only one who couldn't care less about your
> pre-alpha hack with minimum capabilities.
>
> (if I posted hundreds of messages for every pre-alpha hack I've
> ever made, people would quickly label me as an annoying crack-
> pot.)


Sorry if I annoy, but I've only posted a total of about 4 thread-starting
messages. The hundreds of messages have been replies.

We do have active Prothon mailing lists, but no international members yet,
which is why I asked this particular question here.

When I posted my first Prothon messages, I asked if I should stay away from
c.l.p. out of courtesy. I was specifically told to hang around here by
several of the top Pythoneers, because they view Prothon as a potential
learning ground, or sandbox, for Python. So I will do so until those same
top Pythoneers tell me I have worn out my welcome, thank you very much.


 
Reply With Quote
 
Mark Hahn
Guest
Posts: n/a
 
      04-20-2004

"Peter Otten" <(E-Mail Removed)> wrote ...

> >> Apart from that obj$func() hurts my eye more than obj->func() and
> >> obj!func(). As always, Python shines here with its obj.func()

> >
> > I believe the suggestion is "$.func()" instead of "self.func()" (the
> > Python way) or just ".func()" (the earlier Prothon way). Or possibly
> > the suggestion is for "$func()", although I like $.func() much better.


I guess I should outline my whole proposal for $ in Prothon. I'll try to be
brief.

Statement of problem:

# in python

class klass:
def __init__(self):
self.me = 1
def func(self):
print "func1,self"+str(self.me),

class klass2(klass):
def __init__(self):
self.me = 2
def func(self):
klass.func(self)
print "func2,self"+str(self.me),

inst = klass2()
inst.func() # prints func1,self2 func2,self2

#in Prothon

Klass = Object()
with Klass:
.me = 0
def .__init__():
.me = 1
def .func():
print "func1,self"+.me,

Klass2 = Klass()
with Klass2:
def .__init__():
.me = 2
def .func():
Klass.func() # does not do what python does
print "func2,self"+.me,

inst = Klass2()
inst.func() # prints func1,self0 func2,self2

As you can see, the call Klass.func() got the function func from the object
Klass and then called it on Klass using Klass as the target "self" instead
of the instance "inst". In Python the call klass.func was different because
Python knows that klass is a class and therefore obviously cannot be the
target of call (an instance), so it made the programmer pass the instance to
use as a parameter (something Prothon never does).

To fix this, we have to make things more explicit in Prothon. This is a
GOOD thing, making things more explicit. It makes things simpler. We have
four different proposals over on the Prothon mailing lists right now. I'll
show mine here right now briefly by just showing a bunch of sample code
lines:

$.var # $ replaces Python's self (think $elf)
$var # same thing (. is optional after $ self symbol)
obj.func() # get func from obj and bind to obj during call
obj$func() # get func from obj and bind to self during call
x = obj.func # get func from obj (simple attr retrieval)
bm = obj..func # get func from obj and make bound method from obj and func
bm = obj$$func # get func from obj and make bound method from self and func
with bobj: cobj$func() # get func from cobj and bind to bobj during call
with bobj: bm = cobj$$func # get func from cobj and make bound method from
bobj

Now we can fix the problem stated above using the example in the fourth line
above ( obj$func() ):

Klass = Object()
with Klass:
.me = 0
def .__init__():
.me = 1
def .func():
print "func1,self"+.me,

Klass2 = Klass()
with Klass2:
def .__init__():
.me = 2
def .func():
Klass$func() # ambiguity fixed
print "func2,self"+.me,

inst = Klass2()
inst.func() # prints func1,self2 func2,self2




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
u'\N{dollar sign}' belred Python 1 05-21-2009 01:45 AM
dollar sign literals Jason Williams Perl Misc 8 07-11-2007 02:35 AM
What does dollar sign in ClassName$.class mean? Marcus Leon Java 1 06-07-2006 09:44 PM
ASP.NET: dollar sign ($) changed to undisplayable characters Norman Yuan ASP .Net 0 12-08-2005 11:17 PM
Why use dollar sign $ for variables Dennis Walter Perl Misc 21 07-14-2004 08:01 PM



Advertisments