IBM Z and LinuxONE Languages

Languages

Languages

Broad range of supported development languages and tools allows to transform software delivery practices.

 View Only
  • 1.  PL/I AREA Variables

    Posted Fri November 15, 2019 04:51 PM
    Probably one of the least used types of variables?

    Why don't you use them?

    Do you actually know what they can be used for?

    Why are they nowadays, in this day and age of parsing XML and JSON, more relevant than ever?

    ------------------------------
    Robert Prins
    ------------------------------


  • 2.  RE: PL/I AREA Variables

    Posted Wed January 08, 2020 11:20 AM
    Hi,
    To be honest as an application developer i was not aware of it. 
    As far as i understand AREA allows some user specific memory management functionality.
    Where in parsing xml do you see it's special usefullness?
    br Johann

    ------------------------------
    johann wöckinger
    ------------------------------



  • 3.  RE: PL/I AREA Variables

    Posted Fri January 10, 2020 06:54 PM
    How do you remove a tree structure created from parsing an XML file? Building it inside an PL/I AREA variable, you need just one statement:

    AREA=EMPTY();

    and if you look at the generated code, that's very efficient...

    Ditto for linked lists. No need to FREE each item of the list separately!

    Robert
    --





  • 4.  RE: PL/I AREA Variables

    Posted Mon January 13, 2020 04:47 AM
    Hi,
    Brilliant, thanks for the hints.
    I guarantee i'll give it a try.
    br Johann

    ------------------------------
    johann wöckinger
    ------------------------------



  • 5.  RE: PL/I AREA Variables

    Posted Mon January 13, 2020 02:07 PM
    Johann,

    I was the one who actually suggested that the ALLOC() builtin was changed to allow the specification of an area variable, and the new "NEXTALLOC()" builtin is also one of my suggestions, having used a poor-man's substitute many years ago, directly manipulating the area header (those mysterious 16 bytes at the front of an area). Sadly, NEXTALLOC() return a sysnull pointer if there is no space inside an area, I suggested that it should result in the AREA condition, as that would have made the process of allocation even easier, provided one uses an AREA that is declared as "controlled", inside the AREA condition handler you could just allocate a new one, processing would return to the failing statement, and it would seamlessly continue.

    But that wasn't to be...

    Robert

    --
    Robert AH Prins
    robert(a)prino(d)org