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

Discussion in 'Python' started by Mark Hahn, Apr 20, 2004.

  1. Mark Hahn

    Mark Hahn Guest

    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?
    Mark Hahn, Apr 20, 2004
    #1
    1. Advertising

  2. Mark Hahn wrote:
    > 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?


    Belgian azerty: no problem. Easier to type, in fact, than several other
    symbols that are frequently used while programming, e.g. []{}_.

    --
    "Codito ergo sum"
    Roel Schroeven
    Roel Schroeven, Apr 20, 2004
    #2
    1. Advertising

  3. Mark Hahn

    LB Guest

    "
    > 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?
    >

    $ is a shift-key on italian standard keyboard.

    LB
    LB, Apr 20, 2004
    #3
  4. Mark Hahn wrote:
    > 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?
    >


    Finnish/Swedish keyboards: No problems (AltGr + 4)

    -Petter-
    =?ISO-8859-1?Q?Petter_Holmstr=F6m?=, Apr 20, 2004
    #4
  5. Mark Hahn

    Peter Maas Guest

    LB wrote:
    > $ is a shift-key on italian standard keyboard.


    Also on german standard keyboard.

    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
    -------------------------------------------------------------------
    Peter Maas, Apr 20, 2004
    #5
  6. On Tue, 20 Apr 2004 10:04:35 +0200, Peter Maas <> wrote:
    > LB wrote:
    >> $ is a shift-key on italian standard keyboard.

    >
    > Also on german standard keyboard.


    Just as on the Japanese notebook in front of me.

    Hans-Peter Schröcker
    Hans-Peter Schroecker, Apr 20, 2004
    #6
  7. Mark Hahn

    Peter Otten Guest

    Mark Hahn wrote:

    > 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?


    In Germany every serious programmer has to switch to the American layout
    anyway because of {}[]@\~| (all odd AltGr combinations). As this is no
    problem on Windows and Linux(KDE) (how about the Mac?), I recommend against
    making special character choices based on keyboard layout.

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

    Peter
    Peter Otten, Apr 20, 2004
    #7
  8. Mark Hahn

    Joe Mason Guest

    In article <c62m70$2hu$06$-online.com>, Peter Otten wrote:
    > Mark Hahn wrote:
    >
    >> 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


    <snip>

    > 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 like this better than the ., though I still have no problem with
    writing self all the time, so I prefer sticking to the Python way. It
    solves my main problem with ., which is when you do have to pass self
    explicitly. "function_call(param1, ., parm2)" is much more confusing
    than "function_call(param1, $, param2)".)

    Joe
    Joe Mason, Apr 20, 2004
    #8
  9. On Mon, 19 Apr 2004 23:22:10 -0700
    "Mark Hahn" <> wrote:

    > 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


    Anyone who writes a language like Perl or PHP would use it a lot anyway (all variables start with a symbol, usually $)

    --
    Hugh Macdonald
    The Moving Picture Company
    Hugh Macdonald, Apr 20, 2004
    #9
  10. Mark Hahn

    Peter Otten Guest

    Joe Mason wrote:

    > In article <c62m70$2hu$06$-online.com>, Peter Otten wrote:
    >> Mark Hahn wrote:
    >>
    >>> 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

    >
    > <snip>
    >
    >> 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.

    > (I like this better than the ., though I still have no problem with
    > writing self all the time, so I prefer sticking to the Python way. It
    > solves my main problem with ., which is when you do have to pass self
    > explicitly. "function_call(param1, ., parm2)" is much more confusing
    > than "function_call(param1, $, param2)".)


    [OT] Seems to happen all the time with Python - try to simplify at some
    point and you pay twice elsewhere. Prothon will have a hard time occupying
    a local optimum in beauty/simplicity/usefulness that is both near and
    better than Python. This starts with the name, by the way - it evokes the
    association of prothotype, which looks quite, er, ungreek :)

    Peter
    Peter Otten, Apr 20, 2004
    #10
  11. Mark Hahn

    Guest

    Hello Mark,
    IMO typing dollar($) sign should not be a problem in Sweden and Germany.

    Regards,
    Srijit

    "Mark Hahn" <> 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?
    , Apr 20, 2004
    #11
  12. 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:
    Claves gpg / pgp en hkp://subkeys.pgp.net
    Adriano Varoli Piazza, Apr 20, 2004
    #12
  13. Mark Hahn

    Peter Maas Guest

    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
    -------------------------------------------------------------------
    Peter Maas, Apr 20, 2004
    #13
  14. Mark Hahn

    Peter Otten Guest

    [OT] Keyboard layout, was Re: Dollar sign ($) on foriegn keyboards? (prothon)

    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
    Peter Otten, Apr 20, 2004
    #14
  15. 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>
    Fredrik Lundh, Apr 20, 2004
    #15
  16. Mark Hahn

    Des Small Guest

    "Mark Hahn" <> 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
    Des Small, Apr 20, 2004
    #16
  17. Mark Hahn

    Joe Mason Guest

    In article <c631kk$9j9$04$-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
    Joe Mason, Apr 20, 2004
    #17
  18. Mark Hahn

    Joe Mason Guest

    In article <>, 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
    Joe Mason, Apr 20, 2004
    #18
  19. Mark Hahn

    Mark Hahn Guest

    "Fredrik Lundh" <> 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.
    Mark Hahn, Apr 20, 2004
    #19
  20. Mark Hahn

    Mark Hahn Guest

    "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 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
    Mark Hahn, Apr 20, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Norman Yuan
    Replies:
    0
    Views:
    851
    Norman Yuan
    Dec 8, 2005
  2. Marcus Leon
    Replies:
    1
    Views:
    3,001
    Matt Humphrey
    Jun 7, 2006
  3. Mark Hahn
    Replies:
    41
    Views:
    896
    Paul Boddie
    May 27, 2004
  4. Mark Hahn
    Replies:
    16
    Views:
    454
    Konstantin Veretennicov
    Jun 8, 2004
  5. Mark Hahn
    Replies:
    20
    Views:
    575
    Mark Hahn
    Jul 13, 2004
Loading...

Share This Page