Good afternoon, Steve, Jafar and David,

This is the sort of information that we just have to preserve. I love it. This will allow me to create some debugging routines in conjunction with some other techniques that have been previously found in other docs. Though this will now wait till I'm back on my feet - winter is not the best time to get sick.

Just looking at the UB 2 Edition, this will probably mean that the explanation for "proc" in Appendix 1 can have more detail.

Thanks to you all, I really do appreciate the help.

regards

Bruce Rennie

On 06/12/2013 01:51 AM, David Gamey wrote:
I just love these discussions.  :)

David

    ------------------------------------------------------------------------
    *From:* Jafar Al-Gharaibeh <to.ja...@gmail.com>
    *To:* Steve Wampler <swamp...@noao.edu>
    *Cc:* Unicon <unicon-group@lists.sourceforge.net>; Bruce &
    Breeanna Rennie <bren...@dcsi.net.au>
    *Sent:* Tuesday, June 11, 2013 11:24:33 AM
    *Subject:* Re: [Unicon-group] Name of current procedure

    Steve,

     I thought about &current and proc() but I didn't know I can use
    them together this way. The only missing thing in your solution is
    a second argument to proc(), so it becomes:

     image(proc(&current, 0))

    A quick test showed that the second argument corresponds to how
    deep to look int the stack with 0 means the current level, 1 means
    one level down, up to &level-1 which refers to the starting
    procedure in the co-expression.

    Bruce, below is a short program that makes use  of these facts.

    Cheers,
    Jafar

    procedure main()
      foo()
    end

    procedure foo()
    write("current procedure is:", func_name())
      boo()
    end

    procedure boo()
    write("stack trace:")
     write("---")
     trace()
     write("---")
    end

    procedure trace()
    every write(image(proc(&current, 1 to &level-1)))
    end

    procedure func_name()
        # The calling function is 1 level down
    return image(proc(&current, 1)) ? {="procedure "; return tab(0) }
    end






    On Tue, Jun 11, 2013 at 7:49 AM, Steve Wampler <swamp...@noao.edu
    <mailto:swamp...@noao.edu>> wrote:

        On Tue, Jun 11, 2013 at 10:42:00PM +1000, Bruce & Breeanna
        Rennie wrote:
        > Good evening Jafar,
        >
        > Thanks. I suspect that it will require a change/addition to the
        > runtime at this point. I have a slight workaround that does
        the job
        > for the time being.

        Try:

             image(proc(&current))

        (or some variant - I'm off in the woods with bad network access).

        You'll have to play with the result to strip 'procedure', etc.

        Hope that helps!


        --
        Steve Wampler -- swamp...@noao.edu <mailto:swamp...@noao.edu>
        The gods that smiled on your birth are now laughing out loud.

        
------------------------------------------------------------------------------
        This SF.net email is sponsored by Windows:

        Build for Windows Store.

        http://p.sf.net/sfu/windows-dev2dev
        _______________________________________________
        Unicon-group mailing list
        Unicon-group@lists.sourceforge.net
        <mailto:Unicon-group@lists.sourceforge.net>
        https://lists.sourceforge.net/lists/listinfo/unicon-group



    
------------------------------------------------------------------------------
    This SF.net email is sponsored by Windows:

    Build for Windows Store.

    http://p.sf.net/sfu/windows-dev2dev
    _______________________________________________
    Unicon-group mailing list
    Unicon-group@lists.sourceforge.net
    <mailto:Unicon-group@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/unicon-group




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to