guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wisp literal array syntax for Guile, a good idea?


From: Matt Wette
Subject: Re: wisp literal array syntax for Guile, a good idea?
Date: Sun, 12 Nov 2017 13:20:27 -0800

> On Nov 12, 2017, at 10:34 AM, Arne Babenhauserheide <address@hidden> wrote:
> 
> Hi,
> 
> Wisp¹ as general syntax is pretty much done. The releases this year only
> provided bug fixes and additional examples. A procedure definition looks
> like this:
> 
> define : hello who
>    format #f "Hello ~a!\n"
>                   . who
> 
> From experience with building tools with Wisp² I am pretty happy with
> its syntax; it feels like a sweet spot between minimal syntax-overhead
> and producing easily readable code (leaning a bit more towards minimal
> syntax-overhead than readable/sweet).
> 
> But there is one Guile-specific feature where it is lacking: When
> defining a procedure in Guile, you can add properties by creating a
> literal array as line — or as second line if the first line is a literal
> string that then serves as documentation. This can be used to define
> tests.³ Then a full fledged Hello World! looks like this:
> 
> define : hello who
>    . "Say hello to WHO"
>    . #((tests
>           (test-equal "Hello World!\n"
>                      (hello "World"))))
>    format #f "Hello ~a!\n"
>                   . who

Do you have a syntax for vector literals?  If not, why can't you just write

define : hello who
  "Say hello to WHO"
  vector : tests
      test-equal "hello World" 
        . hello "World
  format #f "Hello ~a!\n"
            . who






reply via email to

[Prev in Thread] Current Thread [Next in Thread]