Announcement

Collapse
No announcement yet.

syntax request change...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • syntax request change...

    Hello,


    Just wanted to throw some more requests at PowerBasic to see what
    they think and maybe even implement.


    1. change CALLBACK FUNCTION to just CALLBACK.
    2. change END FUNCTION, END SUB, END TYPE, END UNION to just END

    I think number one would be very easy to change and number two as
    well because you cant define any one of them inside each other so
    you wont have any parsing problems in the compiler.


    Here are some examples:
    Code:
    callback AboutProc
    end [callback]
    
    function MyFunction as long
    end [function]
    
    sub MySub
    end [sub]
    
    type MyType
    end [type]
    
    union MyUnion
    end [type]





    ------------------
    Cheers

    [This message has been edited by mark smit (edited October 20, 2000).]

  • #2
    Seems an aweful lot like C or Pascal...Hmmmm Bordland does it that way already...


    Perhaps you could try borland? *Grin* (No offense meant)..

    I for one would vote against this however..
    I very much like it like it is, to know WHICH "End" I am ending is nice, not to mention "End" was a reserved word in ANY basic language to end the program, and despite that it's not used it's still an integral part of the structure...


    Scott

    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      Mark,

      This request sounds and looks a whole lot like another
      Stephane.

      I'm sure Stephane will jump on this one, he will want PB
      to add voice recognition to their IDE. How lazy are we
      getting in the 21st century.

      Your suggestion would create one of the biggest loop holes
      for the compiler and the debugger, I can't even imagine
      what the results would be.

      With all the program languages that I have used, none of them
      didn't require a END statement with the respective

      Function
      CALLBACK
      IF
      SELECT
      SUB
      TYPE
      UNION

      Even ASSEMBLER code requires it.

      Even GOSUB's always have a RETURN

      SAMPLE:

      Code:
      FUNCTION DOSOMETHING(x&) AS LONG
          IF X& > 0 THEN
            X&=X&+1
          '   END IF NOT PUT HERE
          SELECT CASE X&
            CASE 2
            CASE 3
          '   END SELECT NOT PUT HERE
      END          ' END WHAT  END IF OR END SELECT OR END FUNCTION
      What a horror show.

      Phil




      ------------------
      E-Mail:
      pt AT pursuersoft DOT com

      Comment


      • #4
        Come on guys, I think you are a bit hard on Mark here, I think Mark was
        just making some suggestions on how to simplify the language a bit. That
        is not in itself a bad thing but it is a bit problematic in this context
        for a number of reasons, it would break a lot of existing code if it was
        changed and there would be considerable difficulties in terms of ambiguity
        for both the programmer and the compiler.

        Not all suggestions are going to make it for all sorts of reasons but I
        hope members will keep making them as it is well known that the PowerBASIC
        staff are good listeners to their customers. We got DDT, TCP/IP support,
        regular expressions and a host of other goodies last time so I am of the
        view that members making constructive suggestions works for all of us.

        Now to hop into the "whishlist", I think Phil's idea of voice recognition
        is a great idea but the one I liked the most was the "Do as I mean" option.

        This could bring 21st century programming into the MAC USER era.

        Regards,

        [email protected]

        ------------------
        hutch at movsd dot com
        The MASM Forum

        www.masm32.com

        Comment


        • #5
          Originally posted by Steve Hutchesson:
          Come on guys, I think you are a bit hard on Mark here, I think Mark was
          just making some suggestions on how to simplify the language a bit.
          I agree with you, Steve. We should accept each others suggestions on this board. We can agree with them or argue against or even ignore them, but we shouldn't flame them. Otherwise no one will suggest anything again here if the only feedback he gets is a flame.


          Now to hop into the "whishlist", I think Phil's idea of voice recognition
          is a great idea but the one I liked the most was the "Do as I mean" option.
          *LOL* Well, I vote for that one, too!

          Serious again. I personally like the ENDs like they are. But that CALLBACK thing is something to consider. Not that I'm to lazy to type FUNCTION CALLBACK, but I tested a couple of programming editors and a lot weren't able to properly locate CALLBACK FUNCTIONs. So CALLBACK or even FUNCTION CALLBACK (for those editor's where SUB/FUNCTION are the hardcoded procedure identifiers for the BASIC language) would make this task easier.

          Knuth

          ------------------
          http://www.softAware.de

          Comment


          • #6
            Thanks Guys!

            I just wanted to get an idea of what other people thought of my
            ideas. I think my suggestion was a bit misunderstood though.

            I was just thinking that it would be kinda of nice to just have
            type CALLBACK instead of typing CALLBACK FUNCTION. In the second
            suggestion I didnt mean for the keyword END to be dropped all
            together I just wanted to have the END type optional.


            END(manditory) SELECT/FUNCTION/SUB/TYPE/UNION(optional)

            END SELECT could just be END
            END FUNCTION could just be END
            END SUB could just be END

            I hope you see what I mean because this is kinda though to explain.
            If a SELECT/FUNCTION/SUB/TYPE/UNION cannot exist inside wach other
            than why would you need to specify what your ending from?

            ------------------
            Cheers

            Comment


            • #7
              Mark, I think that your suggestion is something that should be
              done into the editor. Something like an 'intelligent editor'.
              I mean, when you type end, the editor itselfs adds the other
              part.


              ------------------

              Comment


              • #8
                Mark --

                I agree that suggestions should never be "flamed", but I do see two potential problems with your "END" suggestion...

                The compiler would be forced to produce less-helpful compile-time error messages. Think about a large FUNCTION with lots of SELECTs, IFs, and so on, with END used for everything. If you missed typing (or accidentally deleted) an END, the most the compiler could do would be to say "END EXPECTED" instead of "END SELECT EXPECTED" or "END IF EXPECTED" at the very end of the function. That would make it much harder to find the typo than it is now. Not only that, but the "END EXPECTED" error might point toward a line that says "END", and IMO that would be very confusing to new users.

                Second, a lot of PowerBASIC users started out with DOS BASICs, where END means "exit from the program". New users would probably expect END (by itself) to close the program. Generally speaking, I am against changing the meaning of standard BASIC keywords. And while PB/DLL and PB/CC don't currently support END in that context, it might someday. If that were to happen, it would be impossible for the compiler to understand what you mean by END in the middle of a function or IF-block.

                -- Eric


                ------------------
                Perfect Sync: Perfect Sync Development Tools
                Email: mailto:[email protected][email protected]</A>

                "Not my circus, not my monkeys."

                Comment


                • #9
                  I also agree that suggestions should not be shot down in flames,
                  however when I am cutting code in Pascal or Delphi I allways add
                  comments after every end; statement, ie;

                  procedure DoSomething()
                  begin
                  IF something = something then
                  Begin
                  ....
                  ....
                  ....
                  end; //IF
                  end; //DoSomething

                  I find it adds that extra bit of structure and readability to
                  your code.
                  Anyway, thats my two cents worth, I like it just the way it is.

                  Have Fun.
                  N.


                  ------------------


                  [This message has been edited by Neil Hosgood (edited October 22, 2000).]

                  Comment


                  • #10
                    Hello...


                    You guys are not seeing the point I was trying to make.
                    I give up... I guess I'll just have to conform to the borg!



                    ------------------
                    Cheers

                    Comment


                    • #11
                      Mark,

                      I think the idea of being able to use end shouldn't be implimented. I get what you mean, and I'm sure the compiler can guess but it's not really saving much typing and I thinks cut's a little away from the readability (although not much I suppose)
                      Why do you want this changed? what are the advantages to us as a programmer if the change is made? not much of a time save! unless I'm missing the point

                      ------------------

                      Paul Dwyer
                      Network Engineer
                      Aussie in Tokyo
                      (Paul282 at VB-World)

                      Comment


                      • #12
                        I personally agree... for the little amount of typing it saves, it makes the code much harder to read a year in the future when you have forgotten all about what was intended.

                        Additionally, the simple act of deleting the wrong line of code above an END statement could change the definition of the END statement (as the compiler see's it).

                        In that sense, this type of "small simplification" of the language could cause all sorts of problems (especially for newcomers to PowerBASIC), and hence more Tech Support work, leave alone additional debugging work.

                        That said, I will pass the idea along to R&D, but don't hold your breath for it to be implemented. Remember, R&D make the decisions on new features, not me... I'm just sticking in my $0.02.



                        ------------------
                        Lance
                        PowerBASIC Support
                        mailto:[email protected][email protected]</A>
                        Lance
                        mailto:[email protected]

                        Comment

                        Working...
                        X