• Re: Array constructor in Guile?

    From Lawrence D'Oliveiro@21:1/5 to Axel Reichert on Thu Apr 18 07:33:44 2024
    XPost: comp.lang.lisp

    On Thu, 18 Apr 2024 08:02:29 +0200, Axel Reichert wrote:

    But I did not find an array "constructor" syntax that allows me to
    create an array such as

    #2((2 1) ((+ 2 3) 6))

    resulting in

    #2((2 1) (5 6))

    (list->array 2 `((2 1) (,(+ 2 3) 6)))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Axel Reichert@21:1/5 to Lawrence D'Oliveiro on Thu Apr 18 19:51:16 2024
    XPost: comp.lang.lisp

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Thu, 18 Apr 2024 08:02:29 +0200, Axel Reichert wrote:

    But I did not find an array "constructor" syntax that allows me to
    create an array such as

    #2((2 1) ((+ 2 3) 6))

    resulting in

    #2((2 1) (5 6))

    (list->array 2 `((2 1) (,(+ 2 3) 6)))

    Great, thanks, did not see this idea.

    Best regards

    Axel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to All on Fri Apr 19 15:08:04 2024
    XPost: comp.lang.lisp

    #2((2 1) ((+ 2 3) 6))

    Hmm... I see they implemented quasiquotation for vectors but not
    for arrays:

    scheme@(guile-user)> `#(1 2 ,(+ 3 4))
    $1 = #(1 2 7)
    scheme@(guile-user)> `#2((1 2) (,(+ 3 4) 5))
    $2 = #2((1 2) ((unquote (+ 3 4)) 5))
    scheme@(guile-user)>

    I suggest you file a feature request for that.


    Stefan

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