Menu

#314 `end` keyword when specifying output buffers for gnuplot

v1.0_(example)
closed-fixed
nobody
None
5
2024-11-20
2024-11-20
No

Summary

There is an issue with using the end keyword in gretl when specifying output buffers for the gnuplot command. The command fails to execute correctly when using S[end] as the output buffer.

Question: Is this actually a bug or some unconsidered special case?

Steps to Reproduce

  1. Execute the following commands:
clear
set verbose off
open denmark --quiet

# Test the "end" keyword
strings S = array(1)
print S[end]        # WORKS: empty as expected
S[1] = "ABC"
print S[end]        # WORKS: content as expected

gnuplot LRM LRY --with-lines --time-series --outbuf=S[1]    # WORKS
gnuplot LRM LRY --with-lines --time-series --outbuf=S[end]   # FAILS

Expected Behavior

The gnuplot command should successfully execute and use S[end] as the output buffer, similar to how it works with S[1].

Actual Behavior

Using S[end] as the output buffer in the gnuplot command results in a failure, while using S[1] works without issues.

Additional Information

This bug seems to indicate a problem with how the end keyword is handled in the context of output buffers for the gnuplot command. It would be beneficial to ensure that the end keyword can be used consistently across different commands.

Environment

  • gretl version: very recent git version
  • Operating System: ubuntu

Thank you!

Discussion

  • Allin Cottrell

    Allin Cottrell - 2024-11-20

    In the option-string context we're not in full "genr" mode, and were expecting either a plain index number or an expression that yields an integer. However, "end" is now supported as a special case if we know the string in question is supposed to specify an array element.

     
  • Allin Cottrell

    Allin Cottrell - 2024-11-20
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.