[ANN] GNU Artanis-0.5.1 (stable) released!

2021-12-27 Thread Nala Ginrut

GNU Artanis is a web application framework(WAF) written in Guile Scheme.
https://web-artanis.com
Or the alternative domain name:
https://artanis.dev

It is designed to support the development of dynamic websites, web
applications, web services and web resources. Artanis provides several
tools for web development: database access, templating frameworks,
session management, URL-remapping for RESTful, page caching, and so on.

GNU Artanis is under GPLv3+ & LGPLv3+ (dual licenses).

Here are the compressed sources:
  http://ftp.gnu.org/gnu/artanis//artanis-0.5.1.tar.gz   (528KB)
  http://ftp.gnu.org/gnu/artanis//artanis-0.5.1.tar.bz2   (440KB)

Here are the GPG detached signatures[*]:
  http://ftp.gnu.org/gnu/artanis//artanis-0.5.1.tar.gz.sig
  http://ftp.gnu.org/gnu/artanis//artanis-0.5.1.tar.bz2.sig

Use a mirror for higher download bandwidth:
  http://www.gnu.org/order/ftp.html

Here are the MD5 and SHA1 checksums:

2a4f69e1d7ba7be226af5d666c9aec67  artanis-0.5.1.tar.gz
43c996cf7ab0829fc53d4f669626d6ae  artanis-0.5.1.tar.bz2
bc56edb3e6eca37b538d0e635960a320e5df4f7d  artanis-0.5.1.tar.gz
41fce5914071699c57e4e78d07ca1e68814a725c  artanis-0.5.1.tar.bz2

[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact.  First, be sure to download both the .sig file
and the corresponding tarball.  Then, run a command like this:

  gpg --verify artanis-0.5.1.tar.gz.sig

If that command fails because you don't have the required public key,
then run this command to import it:

  gpg --keyserver keys.gnupg.net --recv-keys 
F53B4C5695B5E4D56093432484696772846A0058

and rerun the 'gpg --verify' command.

This release was bootstrapped with the following tools:
  Autoconf 2.69
  Guile 3.0.5

NEWS

Changes in 0.5.1
* Notable changes
- Fix cookies
- Fix redirect-to to use host.name if set
- Remove useless valid field in session
- Show 'art create' options in auto complete
- Support js hash


-- 
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058


signature.asc
Description: PGP signature


sxml-match bad pattern syntax

2021-12-27 Thread Thien-Thi Nguyen

In an effort to join the current millennium, i have started to
play w/ Guile 2.x's SXML facilities.  Good stuff!  I've run into
a problem, however, and hope i can get help resolving it here.

The following small program attempts to use ‘sxml-match’ to
remove an unwanted attribute from a (well-formed) SXML snippet.
#!/usr/bin/guile -s
!#
(use-modules
 (sxml match))

(define (unbogus x)
  (sxml-match x
((a (@ . ,attrs) ...)
 `(a (@ ,@(delete '(shape "rect") attrs)) ...

(define bad '(a (@ (shape "rect") (href "foo.html")) "kid"))

(pk bad)

(pk (unbogus bad))
;; expect: (a (@ (href "foo.html")) "kid")

When i run it, i see it fail w/ error message:

 sxml/sxml-match.ss:342:31: Throw to key `sxml-match-error'
 with args `(#f "bad pattern syntax (symbol not allowed
 in this context)" [...]

(output folded and truncated).  To my untrained eye, the form
looks similar to the examples in Info node ‘(guile) sxml-match’
but evidently i am missing something.  What?

-- 
Thien-Thi Nguyen ---
 (defun responsep (query)   ; (2021) Software Libero
   (pcase (context query)   ;   = Dissenso Etico
 (`(technical ,ml) (correctp ml))
 ...))  748E A0E8 1CB8 A748 9BFA
--- 6CE4 6703 2224 4C80 7502



signature.asc
Description: PGP signature


Re: sxml-match bad pattern syntax

2021-12-27 Thread tomas
On Tue, Dec 28, 2021 at 01:21:31AM -0500, Thien-Thi Nguyen wrote:
> 
> In an effort to join the current millennium,

:-)

> i have started to
> play w/ Guile 2.x's SXML facilities.  Good stuff!  I've run into
> a problem, however, and hope i can get help resolving it here.
> 
> The following small program attempts to use ‘sxml-match’ to
> remove an unwanted attribute from a (well-formed) SXML snippet.

> #!/usr/bin/guile -s
> !#
> (use-modules
>  (sxml match))
> 
> (define (unbogus x)
>   (sxml-match x
> ((a (@ . ,attrs) ...)
>  `(a (@ ,@(delete '(shape "rect") attrs)) ...

I /think/ the ellipsis is at a wrong place there. Note that I'm coming
from "traditional" match, and I just have wrapped half of my brain
around that (which, BTW, is somewhat painful :-)

So take this with a grain of salt.

* Phenomenology (aka: I barely know what I'm doing):

If you replace your ellipses above by ". ,rest", things seem to work:

 (define (unbogus x)
   (sxml-match x
 ((a (@ . ,attrs) . ,rest)
  `(a (@ ,@(delete '(shape "rect") attrs)) . ,rest

 (unbogus '(a (@ (shape "rect") (href "foo.html")) "kid"))

 => (a (@ (href "foo.html")) "kid")

* Philosophy (aka blah, blah)

If those ellipses resemble what match do, I think they are wrong there:

  (@ . ,attrs) ...

would mean zero or more times the shape "(@ . ,attrs)". I think this
isn't what you want.

Put grains of salt everywhere :)

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: sxml-match bad pattern syntax

2021-12-27 Thread Thien-Thi Nguyen

() 
() Tue, 28 Dec 2021 08:19:04 +0100

   I /think/ the ellipsis is at a wrong place there. Note that
   I'm coming from "traditional" match, and I just have wrapped
   half of my brain around that (which, BTW, is somewhat painful
   :-)

Haha, i know exactly how you feel.

   So take this with a grain of salt.

   * Phenomenology (aka: I barely know what I'm doing):

   If you replace your ellipses above by ". ,rest", things seem
   to work:

(define (unbogus x)
  (sxml-match x
((a (@ . ,attrs) . ,rest)
 `(a (@ ,@(delete '(shape "rect") attrs)) . ,rest

(unbogus '(a (@ (shape "rect") (href "foo.html")) "kid"))

=> (a (@ (href "foo.html")) "kid")

Cool.  I guest the ". ,rest" is a shortcut for the ellipses.

   * Philosophy (aka blah, blah)

   If those ellipses resemble what match do, I think they are
   wrong there:

 (@ . ,attrs) ...

   would mean zero or more times the shape "(@ . ,attrs)". I
   think this isn't what you want.

Ah, right!  The ellipses are a tail that need to follow a head.
I guess i was confused by the documentation's use of ellipses in
the conventional sense rather than the literal sense:

 (define (album->html x)
   (sxml-match x
 [(album (@ (title ,t)) (catalog (num ,n) (fmt ,f)) ...)
  `(ul (li ,t)
   (li (b ,n) (i ,f)) ...)]))

Anyway, thanks to your help, i've managed to cobble together the
following code, attached here for the benefit of future self:
#!/usr/bin/guile -s
!#
(use-modules
 (ice-9 pretty-print)
 (sxml match))

(define (pp x)
  (pretty-print x)
  (newline))

(define (unbogus x)
  (sxml-match x
((a (@ . ,attrs) . ,rest)
 `(a (@ ,@(delete '(shape "rect") attrs)) . ,rest))
(,otherwise
 (if (string? x)
 x
 `(,(car x) ,(cadr x)
   ,@(map unbogus (cddr x)))

(define one '(a (@ (shape "rect") (href "foo.html")) "kid"))
(newline)
(pp one)
(pp (unbogus one))

(define bad `(p (@) "some text and " ,one " and " ,one))
(newline)
(pp bad)
(pp (unbogus bad))
Maybe it's idiomatic.  Feedback on how to improve it welcome!

-- 
Thien-Thi Nguyen ---
 (defun responsep (query)   ; (2021) Software Libero
   (pcase (context query)   ;   = Dissenso Etico
 (`(technical ,ml) (correctp ml))
 ...))  748E A0E8 1CB8 A748 9BFA
--- 6CE4 6703 2224 4C80 7502



signature.asc
Description: PGP signature