• Re: Internal representation of list components

    From Christian Gollwitzer@21:1/5 to All on Sat Feb 12 10:04:20 2022
    Am 12.02.22 um 10:02 schrieb Christian Gollwitzer:
    Am 12.02.22 um 09:20 schrieb Roderick:

    What is the internal representation of the components of

    set L [list a [expr 1.0/3]]

    ?

    Are they internally objects of different type?

     C doubles (double precision floats). YOu can find this via tcl::unsupported::representation


    Example:


    (Sources) 49 % set L [list a [expr 1.0/3]] ; puts Hi
    Hi
    (Sources) 50 % ::tcl::unsupported::representation [lindex $L 0]
    value is a pure string with a refcount of 4, object pointer at
    0x7f9d984c62c0, string representation "a"
    (Sources) 51 % ::tcl::unsupported::representation [lindex $L 1]
    value is a double with a refcount of 3, object pointer at
    0x7f9d984c6170, internal representation 0x3fd5555555555555:0x0, no
    string representation
    (Sources) 52 %

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to All on Sat Feb 12 08:20:43 2022
    What is the internal representation of the components of

    set L [list a [expr 1.0/3]]

    ?

    Are they internally objects of different type?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Sat Feb 12 10:02:43 2022
    Am 12.02.22 um 09:20 schrieb Roderick:

    What is the internal representation of the components of

    set L [list a [expr 1.0/3]]

    ?

    Are they internally objects of different type?

    C doubles (double precision floats). YOu can find this via tcl::unsupported::representation

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to Christian Gollwitzer on Sat Feb 12 09:20:38 2022
    On Sat, 12 Feb 2022, Christian Gollwitzer wrote:

    C doubles (double precision floats). YOu can find this via tcl::unsupported::representation

    Nice to know that lists may contain objects of different type.

    I was just learning R, and dreaming that Tcl have similar features,
    but in the simple tcl style, perhaps as package.

    But as I understand, not even python with all efforts reached the
    level of R in statistical packages and graphical representation.
    No way other than learning R.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From heinrichmartin@21:1/5 to Roderick on Sat Feb 12 10:49:07 2022
    On Saturday, February 12, 2022 at 10:21:21 AM UTC+1, Roderick wrote:
    But as I understand, not even python with all efforts reached the
    level of R in statistical packages and graphical representation.
    No way other than learning R.

    That depends on features and performance you are after. Have you looked at VecTcl or ::math::statistics?
    http://auriocus.github.io/VecTcl/ https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/math/statistics.md

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to heinrichmartin on Sun Feb 13 19:30:00 2022
    On Sat, 12 Feb 2022, heinrichmartin wrote:

    That depends on features and performance you are after. Have you looked
    at VecTcl or ::math::statistics?

    Thanks. Since long I wanted to play with VecTcl. ::math::statistics
    is new to me. Good to know.

    R.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)