Board index » delphi » Pascal Standards FAQ at Pascal Central

Pascal Standards FAQ at Pascal Central

Now at Pascal Central is a Pascal Standards FAQ.  It's been truncated from
the original version, so if anyone knows where I can find the missing
part, please let me know.  The parts which are there, however, are very
interesting.  Take a look when you get the chance.

Check out the Pascal Central web site:

http://users.aol.com/catambay/pascal.html

The intent of Pascal Central is to provide the pascal community one place
to obtain Pascal technical information, Pascal source code, and
Pascal-related internet links.

If you have any pascal-related articles, documented source code or book
reviews you think would be of benefit to the Pascal community, let me
know.  I'm always looking to the Pascal community to help mature the
contents of Pascal Central.

Thanks,
Bill

_____________________________________________________________________
Bill Catambay
Pascal Programmer on Macintosh and Open VMS

              />
             //   The purpose of software engineering  
     (//////[O]>=========================================-
             \\    is to manage complexity, not to create it.
              \>

____________________________________________________________________

 

Re:Pascal Standards FAQ at Pascal Central


Now at Pascal Central is a Pascal Standards FAQ.  It's been truncated from
the original version, so if anyone knows where I can find the missing
part, please let me know.  The parts which are there, however, are very
interesting.  Take a look when you get the chance.

Check out the Pascal Central web site:

http://users.aol.com/catambay/pascal.html

The intent of Pascal Central is to provide the pascal community one place
to obtain Pascal technical information, Pascal source code, and
Pascal-related internet links.

If you have any pascal-related articles, documented source code or book
reviews you think would be of benefit to the Pascal community, let me
know.  I'm always looking to the Pascal community to help mature the
contents of Pascal Central.

Thanks,
Bill

_____________________________________________________________________
Bill Catambay
Pascal Programmer on Macintosh and Open VMS

              />
             //   The purpose of software engineering  
     (//////[O]>=========================================-
             \\    is to manage complexity, not to create it.
              \>

____________________________________________________________________

Re:Pascal Standards FAQ at Pascal Central


Quote
Bill Catambay <catam...@aol.com> wrote:

] Now at Pascal Central is a Pascal Standards FAQ.  It's been truncated
] from the original version, so if anyone knows where I can find the
] missing part, please let me know.  The parts which are there, however,
] are very interesting.  Take a look when you get the chance.

-snip + header trim-
Below is a small portion of the Pascal Standard FAQ that you have online
and the rest of it which you lost.  You might want to look it up using
deja news - that's how I found it.

======================================================================

      In Extended Pascal, files are considered entities external to your
      program. External entities, which don't need to be files, need to
      be bound to a variable your program. Any variable to which
      external entities can be bound needs to be declared bindable. So
      the variable declaration of t becomes:

        var
          t : bindable text;

      Extended Pascal has the bind function that binds a variable with
      an external entity.  Here is an Extended Pascal procedure that
      emulates the Assign procedure in Turbo Pascal.

        procedure Assign(var t : text; protected Name : string);
        var
          b : BindingType;
        begin
          unbind (t);
          b := binding (t);
          b.Name := Name;
          bind (t, b);
          b := binding (t);
        end;

      Comments: the unbind procedure unbinds a bindable variable from
      its external entity. If it is not bound, nothing happens. The
      binding function initializes b. We call binding to set some fields
      of the BindingType record. Next we set the name field to the name
      of the file. Calling bind will bind t to the external entity. If
      we now call binding again, we get the current state of t's binding
      type. We can now check for example if the bind has succeeded by:

        if not b.bound then
          { do error processing }

      Note that Prospero's Pascal defaults to creating the file if it
      does not exists! You need to use Prospero's local addition of
      setting b.existing to true to work-around this.

      I've not worked with binary files enough, so no advice yet on how
      to access them, but you access them much the same.

      As last an example of getting the size of a file.

        function FileSize(filename : String) : integer;
        var
          f : bindable file [0..MaxInt] of char;
          b : BindingType;
        begin
          unbind(f);
          b := binding (f);
          b.Name := filename;
          bind(f, b);
          b := binding(f);
          SeekRead(f, 0);
          if empty(f)
           then  filesize := 0
           else  filesize := LastPosition(f) + 1;
          unbind(f);
        end(*file_size*);

      [Prospero's Extended Pascal for DOS has a bug in this case.
      Replace the MaxInt in the type definition of f by a sufficiently large
      integer. Prospero's 32-bit Extended Pascal and GNU Pascal work
      correctly in this case.]

7. Various suggestions for enhancements/changes to the Pascal standards

   If you have comments, suggestions, opinions, etc. about future Pascal
   standards work, please speak up!  Send them to the committee and we'll
   put them on the agenda.  However, to be honest, without a person who has
   an interest in the new feature, they tend to dry up and die.  So, if you
   REALLY want a feature in the Pascal standards, be prepared to write up
   CONVINCING arguments about standarizing.  I'll warn you now not to bias
   them to any particular system or hardware.  If what you suggest won't
   work (at least conceptually) on all machines from Crays,  Alphas,
   Pentiums, OS/2, OpenVMS, DOS, NT, Windows, etc., then you'll have a very
   hard time to get it in the standard.  You don't have to prove that its
   implementable (although it helps) or even easy to implement...  That
   doesn't mean that you can't suggest something that is implementation
   defined (MAXINT for example), but such a feature better have some
   redeeming reason to be included in the standard.

   We can certainly discuss potential changes here in comp.lang.pascal,
   but in my opinion, the amount of Turbo Pascal-specific information
   might make it hard to carry on a discussion.  If so, then lets try
   to have some key in the subject line so we can quickly spot them.
   Alternatively, if the comp.std.pascal newsgroup goes ahead, then
   that would be the perfect spot for new feature discussions for the
   Pascal standards.

   Here are a few changes/additions to Extended Pascal that have bounced
   around the newsgroup (I may or may not support each of the following
   items or even know what they mean, I'm just writing them down).

   - optional parameter to HALT procedure
   - allow repeating of procedure/function declaration in module
     implementation (as already suggested in the OOP document)
   - allow to test for file existence (add an 'existing' field to
     BindingType or something like that)
   - allow type-casts
   - provide for a "total export" option so you don't have to specify
     each item in an interface
   - provide true procedure/function types

   I think that each of these items could be discussed and produce some
   positive suggestions.

 *****************************************************************************
8. Required Interfaces to Extended Pascal

   The Extended Pascal standard includes 2 concepts that provide hooks
   for interfaces to things outside of Pascal.

   Firstly, Extended Pascal has an IMPORT declaration that brings in
   an interface.  Extended Pascal's interfaces correspond to Turbo Pascal's
   units.

   When Extended Pascal was being worked on, the committee asked itself
   if there should be any required interfaces or required bindings (other
   than for file variables).  At first, there was of talk about all
   sorts of require interfaces (for sorting, for screen mangement, etc.)
   However, any such talk quickly deteriorated when we started talking
   about things like keyboards, joysticks, vector processors, etc.  Just
   as one couldn't imagine a joystick on a Cray, we couldn't imagine a
   vector processor on a 286 DOS machine.  So the idea of REQUIRED interfaces
   was quickly dismissed.  Next the committee said "what if we specify an
   interface and say 'if you provide it, you must provide at least this
   much'".  That had quite a bit of support, but when push came to shove,
   it also vanished from the standard leaving absolute no hint of any
   required interfaces.

   I certainly think we could discuss interface definitions that would
   be 'if you provide it, you must provide at least this much'.

   Recently, there was some early discussion about a keyboard interface.
   I think that would be a good starting point.  Here again, I would say
   that any proposed interface must deal with multiple types of keyboards.
   Like those that return multiple-bytes for each key pressed, for keyboards
   in different countries that have other characters on keys that aren't
   in the "normal" Latin-1 character set, etc.

   Other interfaces might include a printing package, screen package,
   I/O package, GKS, X-windows, an object-oriented visual environment,
   networking, etc.  

   Secondly, Extended Pascal has a BIND statement that binds a variable to
   an external entity.  Extended Pascal uses BIND to bind a file variable to
   an external file such that it can then be processed with READ, WRITE, etc.
   This feature is much less "procedural" than using interface (Extended
   Pascal does not provide operator overloading and therefore importing
   an interface can only provide access to procedures, functions, variables,
   types, and constants, but not operators).

   One could imaging binding an integer variable to an I/O port and every
   use of the variable would read from the port and every write to the
   variable would write to the port.  You might even want to combine
   interfaces and bindings.  The possibilities (and discussions) are
   endless...

 *****************************************************************************
9. Foreword to Extended Pascal standard with history and list of features

   Here is part of the foreword from the Extended Pascal standard to provide
   some history of it (and of unextended Pascal).

    Project History

    In 1977, a working group was formed within the British Standards
    Institution (BSI) to produce a standard for the programming language
    Pascal.  This group produced several working drafts, the first draft for
    public comment being widely published in 1979.  In 1978, BSI's proposal
    that Pascal be added to ISO's program of work was accepted, and the ISO
    Pascal Working Group (then designated ISO/TC97/SC5/WG4) was formed in
    1979.  The Pascal standard was to be published by BSI on behalf of ISO,
    and this British Standard referenced by the International Standard.

    In the USA, in the fall of 1978, application was made to the IEEE
    Standards Board by the IEEE Computer Society to authorize project 770
    (Pascal). After approval, the first meeting was held in January 1979.

    In December of 1978, X3J9 convened as a result of a SPARC (Standards
    Planning and Requirements Committee) resolution to form a US TAG
    (Technical Advisory Group) for the ISO Pascal standardization effor
    initiated by the UK. These effors were performed under X3 project 317.

    In agreement with IEEE representatives, in February of 1979, an X3
    resolution combined the X3J9 and P770 committees into a single committee
    called the Joint X3J9/IEEE P770 Pascal Standards Committee (Throughout,
    the term JPC refers to this committee.)  The first meeting as JPC was held
    in April 1979. The resolution to form JPC clarified the dual function of
    the single joint committee to produce a dpANS and a
...

read more »

Other Threads