lisp-project-of-the-day icon indicating copy to clipboard operation
lisp-project-of-the-day copied to clipboard

data-table

Open utterances-bot opened this issue 5 years ago • 5 comments

data-table

http://40ants.com/lisp-project-of-the-day/2020/05/0082-data-table.html

utterances-bot avatar May 30 '20 21:05 utterances-bot

Hi,

Thanks for the continuous stream of CL libraries review.

I think print-object (printed representation) is more suitable than describe-object (object description, or/and internal information). check their definitions in CLHS, Moreover, it will be less typing at the repl, just type dt and ENTER (faster feedback).

something similar about usage of print-object: https://groups.google.com/forum/?hl=en#!original/comp.lang.lisp/H1OYLPO3E7o/ANy2du9l7FoJ

Regards,

alaa-alawi avatar May 30 '20 21:05 alaa-alawi

Usage of print-object can break formatting in tracebacks:

 0: (SB-KERNEL:ASSERT-ERROR (< CL-SLICE-DEV::SLICE CL-SLICE-DEV::AXIS) 2 CL-SLICE-DEV::SLICE 63 CL-SLICE-DEV::AXIS 63)
 1: ((:METHOD CL-SLICE-DEV:CANONICAL-REPRESENTATION (INTEGER INTEGER)) 63 63) [fast-method]
 2: ((:METHOD CL-SLICE-DEV:CANONICAL-REPRESENTATION (T CONS)) 63 (53 . 63)) [fast-method]
 3: (CL-SLICE-DEV:CANONICAL-REPRESENTATIONS (63) ((53 . 63)))
 4: ((:METHOD CL-SLICE:SLICE (ARRAY)) #("2020-03-01" "2020-03-02" "2020-03-03" "2020-03-04" "2020-03-05" "2020-03-06" ...) (53 . 63)) [fast-method]
 5: (SLICE +----------------+--------------+ ..)
      Locals:
        #:.DEFAULTING-TEMP. = -10
        #:.DEFAULTING-TEMP.#1 = NIL
        COLUMNS = NIL
        COLUMNS#1 = NIL
        DATA-FRAME = +------------+--------------+
| Date       | Prof .25     |
+------------+--------------+
| 2020-03-01 |   -1.5830414 |
| 2020-03-02 |   -1.1816742 |
| 2020-03-03 |          0.0 |
| 2020-03-04 |    4.9093776 |
| 2020-03-05 |    3.3525248 |
| 2020-03-06 |     -1.39572 |

svetlyak40wt avatar May 31 '20 12:05 svetlyak40wt

This is normal for any multi-line string.

alaa-alawi avatar May 31 '20 20:05 alaa-alawi

I'm wondering if there is use some pretty-printer feature which will do proper printing for such multiline data?

svetlyak40wt avatar Jun 05 '20 16:06 svetlyak40wt

Slime has a pretty-printing configuration if you checked swank. but the indentation in the debugger is hardcoded for printing 'Locals:', check the slime.el file.

On Fri, Jun 5, 2020 at 8:48 PM Alexander Artemenko [email protected] wrote:

I'm wondering if there is use some pretty-printer feature which will do proper printing for such multiline data?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/40ants/lisp-project-of-the-day/issues/7#issuecomment-639623932, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAILUPCK56PO56LAN356HTDRVEOUBANCNFSM4NO3NZQA .

alaa-alawi avatar Jun 06 '20 20:06 alaa-alawi