Streamline internals of teapot #59

Closed
opened 2019-08-19 20:22:55 +00:00 by glen · 7 comments
Owner

The primary proposed change here is to add a "funcall" token, so that an entire expression can be encapsulated as a single expression; then the content and iterative content just become tokens like the value and the base value, rather than the more cumbersome token vectors. This allows parse trees to be stored, simplifying evaluation and allowing future extensions (like #56).

This change will break savexdr(); there is no point in preserving it, since the world does not need another binary spreadsheet format. Keep loadxdr() working to
preserve backward compatibility.

While we are at it, add another token to a cell for future use for computed attributes. (cf. #22).

Also may as well change from doubles and ints as values to long doubles and long longs.

The primary proposed change here is to add a "funcall" token, so that an entire expression can be encapsulated as a single expression; then the content and iterative content just become tokens like the value and the base value, rather than the more cumbersome token vectors. This allows parse trees to be stored, simplifying evaluation and allowing future extensions (like #56). This change will break savexdr(); there is no point in preserving it, since the world does not need another binary spreadsheet format. Keep loadxdr() working to preserve backward compatibility. While we are at it, add another token to a cell for future use for computed attributes. (cf. #22). Also may as well change from doubles and ints as values to long doubles and long longs.
glen added the
enhancement
label 2019-08-19 20:22:55 +00:00
Author
Owner

This is now well in progress, nearing completion. Items that must be checked prior to committing are:

A) every function in the func table works
B) go through functions of floats and make sure they deal properly with long doubles
C) go through functions of ints and make sure they are OK with long longs
D) make sure we can load old xdr files for backward compatibility

This is now well in progress, nearing completion. Items that must be checked prior to committing are: A) every function in the func table works B) go through functions of floats and make sure they deal properly with long doubles C) go through functions of ints and make sure they are OK with long longs D) make sure we can load old xdr files for backward compatibility
Author
Owner

OK, I have made a pretty good pass at (B) above

OK, I have made a pretty good pass at (B) above
Author
Owner

And now I am in good shape on (C), so on to (A)

And now I am in good shape on (C), so on to (A)
Author
Owner

Hmm, have an issue clocking the sheet that needs to be debugged.

Hmm, have an issue clocking the sheet that needs to be debugged.
Author
Owner

yes, definitely a cell containing 1 -> @()+1 dies with an assertion when clocked. However, debugging it is blocked by the fact that when run under the debugger, fteapot receives some strange character from the Alt key, and so there is no way to
enter the iterative content.

When I next get a chance, I will debug terminal teapot.

yes, definitely a cell containing 1 -> @()+1 dies with an assertion when clocked. However, debugging it is blocked by the fact that when run under the debugger, fteapot receives some strange character from the Alt key, and so there is no way to enter the iterative content. When I next get a chance, I will debug terminal teapot.
glen closed this issue 2019-08-20 20:44:52 +00:00
glen reopened this issue 2019-08-22 06:16:50 +00:00
Author
Owner

That close was accidental. The clock issue turned out to be minor and is fixed. I have now made at least some test to every function, so it is time to try loading a previously existing xdr file.

That close was accidental. The clock issue turned out to be minor and is fixed. I have now made at least some test to every function, so it is time to try loading a previously existing xdr file.
Author
Owner

OK, with some difficulty got the xdr loading working. So the code just needs final review and then it can be checked in and this issue closed.

OK, with some difficulty got the xdr loading working. So the code just needs final review and then it can be checked in and this issue closed.
glen referenced this issue from a commit 2019-08-23 19:23:00 +00:00
Streamline internals of teapot The primary change is to add a “funcall” token, so that an entire expression can be encapsulated as a single token. This change is used to allow a cell to include simply a selection of appropriate semantic tokens. I.e., the content and iterative content are now each a single token like the value and the result value. Token vectors are used only as intermediate results in scanning and parsing. Not this means the cells are now in effect storing parse trees, so computation should be slightly faster and future extensions (like #56) should be facilitated. This commit also takes the opportunity while internals are being altered to add another token to a cell for future use for computed attributes, cf #22, and to change the internal numerical values from double and ints to long doubles and long longs. However, the change attempts to encapsulate that choice so it would be easy to change back or change to another representation. Note that these changes break savexdr(), as the internal binary format of a cell is now different. Rather than reimplement it, it is deprecated as the world does not need another binary spreadsheet format. Hence, the ascii format for teapot spreadsheets becomes the primary file format. Loading of old xdr files is still supported for backward compatibility. Closes #59. Also along the way, various other slight fixes and enhancements crept in, a partial but probably not exhaustive list of which follows: Fixes #31. Further revisions and improvements to documentation. Make the approximate comparison of floating point values scale more accurately with the size of the doubles being compared. Further extensions of absolute and relative cell addressing. Addition of (circle constant) tau function/constant. Modified string conversion to simply use internal printing routines, and to take "scientific" and "decimal" keywords. Allowed n() function to take a list of values, or just a single location defaulting to the current location. Added floor, ceil, trunc, and round functions, and allowed them to be keywords controlling the int() integer conversion function as well. Allowed substr() to drop its last argument to go to the end of the string. Provided an enum of built-in functions to preserve legacy function identifiers, allowing the large table inside func.c to be reorganized in a clearer fashion. Added additional annotation of properties of the built-in functions, including precedence. All operators are now also accessible as built-in functions. Made precedence of unary - lower than ^ to match python. Avoided inadvertently using FLTK @symbol abbreviations for formulas with "@" in them.
glen closed this issue 2019-08-23 19:23:00 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: glen/teapot-spreadsheet#59
No description provided.