Loading ...
Sorry, an error occurred while loading the content.
 

A few questions from a smalltalker

Expand Messages
  • Bernat Romagosa
    Hi all, I m a smalltalker who s looking to learn Self, and I m wondering whether there s a short tutorial that teaches what should I learn in order to get
    Message 1 of 6 , Oct 25, 2011
      Hi all,

      I'm a smalltalker who's looking to learn Self, and I'm wondering whether there's a short tutorial that teaches what should I learn in order to "get" Self. I've been searching around in this list and in the Self blog, but I couldn't find much stuff.

      The questions that come to my mind when I peek around the Self GUI are:


      * Where is the Class Browser?
      I know this must make no sense in Self as there are no Classes to browse, but then: how do you explore the system library? How do you know which objects are there to copy and what can they do?

      * How does one create an object?
      I'm not sure if "create" is the right word to use. I mean it the same way one would say "instantiate a class" in Smalltalk. I guess if Self has no classes, what you actually do is to "copy" existing objects and modify them, is that right?

      * Can you print stuff?
      I noticed that shells can both DoIt and GetIt stuff, but not PrintIt. Does this respond to some design principle?


      Please excuse me if the questions sound lame or basic, I'm not trying to compare both languages, just looking for a shortcut so I don't have to go through the whole tutorial :)

      Thanks a lot!

      --
      Bernat Romagosa.
    • David Goehrig
      ... Bring up a shell, type lobby in it, and then Get It! Lobby is the entry point to the world, sort of like the Smalltalk object itself, and it containts
      Message 2 of 6 , Oct 25, 2011
        On Oct 25, 2011, at 3:45 AM, Bernat Romagosa <tibabenfortlapalanca@...> wrote:
        * Where is the Class Browser?
        I know this must make no sense in Self as there are no Classes to browse, but then: how do you explore the system library? How do you know which objects are there to copy and what can they do?

        Bring up a shell, type lobby in it, and then Get It!

        Lobby is the entry point to the world, sort of like the Smalltalk object itself, and it containts references to all traits, prototypes, and globals. Applications and utilities as well as core system objects can be found there too. 

        * How does one create an object?
        I'm not sure if "create" is the right word to use. I mean it the same way one would say "instantiate a class" in Smalltalk. I guess if Self has no classes, what you actually do is to "copy" existing objects and modify them, is that right?

        Either copy an existing or create an empty slots object by typing:

        (||)

        And hitting get it. This will give you an inspector you can add slots to. 

        * Can you print stuff?
        I noticed that shells can both DoIt and GetIt stuff, but not PrintIt. Does this respond to some design principle?


        You can print by getting the string of something but it isn't as common an idiom as you can get a manipulable reference to the object itself just as easily. You can always ask an object for it's symbolic form, but it needs the behavior to return that. Since there is no base Object class, there is no guarantee suck a method exists. 

        Selfers just GetIt (tm)

        Hope this helps. 

      • David Ungar
        See below... - David (from iPad, typos likely) ... If you type globals into a shell and do a get-it, you will get the object that is most like the Smalltalk
        Message 3 of 6 , Oct 25, 2011
          See below...

          - David (from iPad, typos likely)

          On Oct 25, 2011, at 8:10 AM, David Goehrig <dave@...> wrote:

           

          On Oct 25, 2011, at 3:45 AM, Bernat Romagosa <tibabenfortlapalanca@...> wrote:
          * Where is the Class Browser?
          I know this must make no sense in Self as there are no Classes to browse, but then: how do you explore the system library? How do you know which objects are there to copy and what can they do?

          Bring up a shell, type lobby in it, and then Get It!

          Lobby is the entry point to the world, sort of like the Smalltalk object itself, and it containts references to all traits, prototypes, and globals. Applications and utilities as well as core system objects can be found there too. 



          If you type 'globals' into a shell and do a get-it, you will get the object that is most like the Smalltalk system dictionary.



          * How does one create an object?
          I'm not sure if "create" is the right word to use. I mean it the same way one would say "instantiate a class" in Smalltalk. I guess if Self has no classes, what you actually do is to "copy" existing objects and modify them, is that right?

          Either copy an existing or create an empty slots object by typing:

          (||)

          And hitting get it. This will give you an inspector you can add slots to. 

          Typically, find an object you like, and then send id 'copy' or 'copyRemoveAll' for a collection.
          Example: 'list copyRemoveAll'



          * Can you print stuff?
          I noticed that shells can both DoIt and GetIt stuff, but not PrintIt. Does this respond to some design principle?


          You can print by getting the string of something but it isn't as common an idiom as you can get a manipulable reference to the object itself just as easily. You can always ask an object for it's symbolic form, but it needs the behavior to return that. Since there is no base Object class, there is no guarantee suck a method exists. 


          Yes. You can send printString or print to many objects.


          Selfers just GetIt (tm)

          Hope this helps. 

        • Russell Allen
          ... Hi Bernat! Sending print or printLine to many objects will print to stdout. If you have started Self from the command line on Linux or Mac then you ll see
          Message 4 of 6 , Oct 25, 2011
            On Tue, 25 Oct 2011 11:23:02 -0700, David Ungar wrote:
            > * CAN YOU PRINT STUFF?
            > I noticed that shells can both DoIt and GetIt stuff, but not PrintIt.
            > Does this respond to some design principle?
            >
            > You can print by getting the string of something but it isn't as
            >> common an idiom as you can get a manipulable reference to the
            > object
            >> itself just as easily. You can always ask an object for it's
            >> symbolic form, but it needs the behavior to return that. Since
            > there
            >> is no base Object class, there is no guarantee suck a method
            > exists.
            >>
            >>
            >> Yes. You can send printString or print to many objects.

            Hi Bernat!

            Sending print or printLine to many objects will print to stdout.

            If you have started Self from the command line on Linux or Mac then
            you'll see it in the terminal you started Self from. If you've started
            Self on Mac by double-clicking a snapshot, then it will probably
            disappear into the ether and you're better off using GetIt.

            May I ask which platform and what snapshot you're using?

            - Russell
          • Bernat Romagosa
            Hi guys, Thanks a lot for the replies! I m using the Self-Latest-Unstable snapshot on a Debian machine. The leap from st to Self is quite bigger than I
            Message 5 of 6 , Oct 26, 2011
              Hi guys,

              Thanks a lot for the replies! I'm using the Self-Latest-Unstable snapshot on a Debian machine.

              The leap from st to Self is quite bigger than I expected, but I think I'm beginning to "get it" hehe

              Another question: do you guys have some kind of public repo where I can check out some projects to get a grasp of what real-world stuff looks like?

              Cheers!

              2011/10/26 Russell Allen <mail@...>
               

              On Tue, 25 Oct 2011 11:23:02 -0700, David Ungar wrote:
              > * CAN YOU PRINT STUFF?


              > I noticed that shells can both DoIt and GetIt stuff, but not PrintIt.
              > Does this respond to some design principle?
              >
              > You can print by getting the string of something but it isn't as
              >> common an idiom as you can get a manipulable reference to the
              > object
              >> itself just as easily. You can always ask an object for it's
              >> symbolic form, but it needs the behavior to return that. Since
              > there
              >> is no base Object class, there is no guarantee suck a method
              > exists.
              >>
              >>
              >> Yes. You can send printString or print to many objects.

              Hi Bernat!

              Sending print or printLine to many objects will print to stdout.

              If you have started Self from the command line on Linux or Mac then
              you'll see it in the terminal you started Self from. If you've started
              Self on Mac by double-clicking a snapshot, then it will probably
              disappear into the ether and you're better off using GetIt.

              May I ask which platform and what snapshot you're using?

              - Russell




              --
              Bernat Romagosa.
            • Russell Allen
              ... Cool, thanks. ... Pretty much all of the stuff is in the Github tree. If you look under self/objects/applications you will see various projects but not all
              Message 6 of 6 , Oct 26, 2011
                On Wed, 26 Oct 2011 09:42:01 +0200, Bernat Romagosa wrote:
                > Hi guys,
                >
                > Thanks a lot for the replies! I'm using the Self-Latest-Unstable
                > snapshot on a Debian machine.

                Cool, thanks.

                > The leap from st to Self is quite bigger than I expected, but I think
                > I'm beginning to "get it" hehe
                >
                > Another question: do you guys have some kind of public repo where I
                > can check out some projects to get a grasp of what real-world stuff
                > looks like?

                Pretty much all of the stuff is in the Github tree. If you look under
                self/objects/applications you will see various projects but not all of
                them will be easy to load. You may be able to get the 4.4 Demo.snap from
                the website to work, it has the Smalltalk-80 subsystem and some
                tutorials loaded.

                To import a Self file either do

                'path/to/my/module.self' runScript

                or, if your current directory is the objects directory, something like:

                bootstrap read: 'module' From: 'applications'

                I'm afraid you will have to put up with rough edges to all this until
                we get them smoothed over in future releases :)

                Cheers, Russell


                >
                > Cheers!
                >
                > 2011/10/26 Russell Allen
                >
                >>  
                >>
                >> On Tue, 25 Oct 2011 11:23:02 -0700, David Ungar wrote:
                >> > * CAN YOU PRINT STUFF?
                >>
                >> > I noticed that shells can both DoIt and GetIt stuff, but not
                >> PrintIt.
                >> > Does this respond to some design principle?
                >> >
                >> > You can print by getting the string of something but it isn't as
                >> >> common an idiom as you can get a manipulable reference to the
                >> > object
                >> >> itself just as easily. You can always ask an object for it's
                >> >> symbolic form, but it needs the behavior to return that. Since
                >> > there
                >> >> is no base Object class, there is no guarantee suck a method
                >> > exists.
                >> >>
                >> >>
                >> >> Yes. You can send printString or print to many objects.
                >>
                >> Hi Bernat!
                >>
                >> Sending print or printLine to many objects will print to stdout.
                >>
                >> If you have started Self from the command line on Linux or Mac
                >> then
                >> you'll see it in the terminal you started Self from. If you've
                >> started
                >> Self on Mac by double-clicking a snapshot, then it will probably
                >> disappear into the ether and you're better off using GetIt.
                >>
                >> May I ask which platform and what snapshot you're using?
                >>
                >> - Russell
                >
                > --
                > Bernat Romagosa.
              Your message has been successfully submitted and would be delivered to recipients shortly.