Menu

#102 gentran clinenen!* ignored

open
nobody
None
5
2019-07-18
2019-07-17
arpi
No

I am generating C code with gentran. I tried setting
clinelen!* := 150;
but the line lenght in the generated C code remained the default 80.

Related

Bugs: #102

Discussion

  • Rainer Schöpf

    Rainer Schöpf - 2019-07-17

    Did you set clinelen!* after loading gentran? The following works for me:

    Reduce (Free PSL version, revision 5012),  4-Jul-2019 ...
    
    1: load_package gentran;
    
    2: gentranlang!* := 'C;
    
    gentranlang* := c
    
    3: clinelen!* := 150;
    
    clinelen* := 150
    
    4: gentran y := eval((a+b)^20);
    y=pow((double)(a),20.0)+20.0*pow((double)(a),19.0)*b+190.0*pow((double)(a),18.0)*(b*b)+1140.0*pow((double)(a),17.0)*(b*b*b)+4845.0*pow((double)(a),
     16.0)*(b*b*b*b)+15504.0*pow((double)(a),15.0)*pow((double)(b),5.0)+38760.0*pow((double)(a),14.0)*pow((double)(b),6.0)+77520.0*pow((double)(a),13.0)*
     pow((double)(b),7.0)+125970.0*pow((double)(a),12.0)*pow((double)(b),8.0)+167960.0*pow((double)(a),11.0)*pow((double)(b),9.0)+184756.0*pow((double)(a)
     ,10.0)*pow((double)(b),10.0)+167960.0*pow((double)(a),9.0)*pow((double)(b),11.0)+125970.0*pow((double)(a),8.0)*pow((double)(b),12.0)+77520.0*pow((
     double)(a),7.0)*pow((double)(b),13.0)+38760.0*pow((double)(a),6.0)*pow((double)(b),14.0)+15504.0*pow((double)(a),5.0)*pow((double)(b),15.0)+4845.0*(a
     *a*a*a)*pow((double)(b),16.0)+1140.0*(a*a*a)*pow((double)(b),17.0)+190.0*(a*a)*pow((double)(b),18.0)+20.0*a*pow((double)(b),19.0)+pow((double)(b),
     20.0);
    
    t
    

    Rainer

     
  • arpi

    arpi - 2019-07-17

    Yes, i did so. However, now I tried text mode reduce, and it also worked. Not so in the X GUI of CSL Reduce.

     
  • Arthur Norman

    Arthur Norman - 2019-07-17

    With the CSL gui I try hard to keep the linelength of the windows at 80.
    This at least started with concern about what on earth to do when and if
    the user resized the windows. There was no good or obvious way to cause
    the lisp/reduce core to be informed of a change in linelength and reformat
    everything to allow for any change. Equally I did not want or feel like
    making a user call to the linelength function to suddenly re-size the
    screen. I also was uncomfortable with ending up with output (especially
    displayed maths) clipped within a scrollable screen. I end up with making
    it such that the menu item that resets the font forces the width of the
    windows to be exactlty 80 characters, and attempts to alter the windows
    width by dragging corners etc should not do that. I had sort of wanted to
    make dragging windows corners to alter size adust the font sizes to keep
    things at 80 columns. That I can do with code that is potentially there
    for the future but rendering characters at non-whole-number font sizes in
    a portable way is not utterly trifling esp when you want to build big
    delimiters out of adjacacnt glyphs.

    The short issue is that altering the linelength for the main terminal
    window in CSL Reduce under its gui is not as effective as you wanted. You
    may have more luck if you are sending the generated C to file not to the
    screen?

    If you wish to work on an alternative behaviour of course all the souce
    code is there for you to play with!

    Arthur

    On Wed, 17 Jul 2019, arpi wrote:


    [bugs:#102] gentran clinenen!* ignored

    Status: open
    Group:
    Created: Wed Jul 17, 2019 03:30 PM UTC by arpi
    Last Updated: Wed Jul 17, 2019 03:30 PM UTC
    Owner: nobody

    I am generating C code with gentran. I tried setting
    clinelen!* := 150;
    but the line lenght in the generated C code remained the default 80.

     

    Related

    Bugs: #102

    • arpi

      arpi - 2019-07-17

      What is surprising is that the setting of the terminal line length affects the line length of a file written using gentran. I set gentranout. I do not know if linelength and
      clinelen!*:=150;
      also interacts in the console mode reduce.

       
      • arpi

        arpi - 2019-07-18

        More precisely, it works correctly with rfcsl, and not with redcsl, run as redcsl -w- or redcsl -w+.

         
        • Arthur Norman

          Arthur Norman - 2019-07-18

          I am on a trip at present and can not investigate details until I am home
          - and even then I will probably feel that some other issues take priority
          unless I find this really trivial, since you have such easy work rounds
          and anyway the length of lines if a file mainly destnes to be consumed by
          a C compiler not read by humans is something I find it hard to get excited
          about!!!! I tried a direct reply to your email that reached us all via
          sourceforge but you have not set yoursef up so that that is accepted -
          please do so and then remind just me about this again in 2 weeks time.
          Arthur

          On Thu, 18 Jul 2019, arpi wrote:

          More precisely, it works correctly with rfcsl, and not with redcsl, run as
          redcsl -w- or redcsl -w+.


          [bugs:#102] gentran clinenen!* ignored

          Status: open
          Group:
          Created: Wed Jul 17, 2019 03:30 PM UTC by arpi
          Last Updated: Wed Jul 17, 2019 08:50 PM UTC
          Owner: nobody

          I am generating C code with gentran. I tried setting
          clinelen!* := 150;
          but the line lenght in the generated C code remained the default 80.


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/reduce-algebra/bugs/102/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Bugs: #102


Log in to post a comment.