Potluck time!

2016-02-10 Thread Ludovic Courtès
Hello Guilers!

As you may know, it’s that time of the year where we are all invited to
prepare dishes and to bring them to the Guile birthday potluck.  This
has become a tradition to celebrate the release of Guile 2, which took
place on Feb. 16th¹, 5 years ago!

So the idea is that you hack up something with Guile, and next Tuesday,
on the 16th, you share your hack with people on this mailing list.

Here are the fine dishes that people brought in previous years:

  2012: http://savannah.gnu.org/forum/forum.php?forum_id=7111
  2013: http://savannah.gnu.org/forum/forum.php?forum_id=7509
  2014: http://savannah.gnu.org/forum/forum.php?forum_id=7887
  2015: https://lists.gnu.org/archive/html/guile-user/2015-02/threads.html

Time to fire up a REPL and hack!  :-)

Thanks,
Ludo’.

¹ https://lists.gnu.org/archive/html/guile-devel/2011-02/msg00173.html



signature.asc
Description: PGP signature


[ANN] GNU Artanis-0.1.2(Beta) released!

2016-02-10 Thread Nala Ginrut
<#secure method=pgpmime mode=sign>

GNU Artanis is a web application framework(WAF) written in Guile Scheme.
The main site of GNU Artanis is here. A web application framework (WAF)
is a software framework that is designed to support the development of
dynamic websites, web applications, web services and web resources. 
The framework aims to alleviate the overhead associated with common
activities performed in web development.
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 also the official project of SZDIY community. It's used
to build server side of SZDIY common service. It is offered to GNU
project to make free software better.

Here are the compressed sources:
  http://alpha.gnu.org/gnu/artanis//artanis-0.1.2.tar.gz   (476KB)
  http://alpha.gnu.org/gnu/artanis//artanis-0.1.2.tar.bz2   (392KB)

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

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

Here are the MD5 and SHA1 checksums:

f1366fe66f982b9359997ed6857f4c8b  artanis-0.1.2.tar.gz
6170fb9c53251c33db18605803a6341c  artanis-0.1.2.tar.bz2
c0f5215841eafeb8a321cd9132d218e7a72dfcd3  artanis-0.1.2.tar.gz
59efafd0f6b4ab79573f78587a35cab7894dfdcb  artanis-0.1.2.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.1.2.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 EE78E925

and rerun the 'gpg --verify' command.

This release was bootstrapped with the following tools:
  Autoconf 2.69.120-5dcda-dirty
  Guile 2.0.11.162-133ec

NEWS

Changes in 0.1.2
* Notable changes
  Rewrited session management.
  Now support three new backends simple/file/db.
  Added HTML template caching.
  Fixed several bugs.
  Updated manual.






Re: Potluck time!

2016-02-10 Thread Christopher Allan Webber
Ludovic Courtès writes:

> Hello Guilers!
>
> As you may know, it’s that time of the year where we are all invited to
> prepare dishes and to bring them to the Guile birthday potluck.  This
> has become a tradition to celebrate the release of Guile 2, which took
> place on Feb. 16th¹, 5 years ago!
>
> So the idea is that you hack up something with Guile, and next Tuesday,
> on the 16th, you share your hack with people on this mailing list.
>
> Here are the fine dishes that people brought in previous years:
>
>   2012: http://savannah.gnu.org/forum/forum.php?forum_id=7111
>   2013: http://savannah.gnu.org/forum/forum.php?forum_id=7509
>   2014: http://savannah.gnu.org/forum/forum.php?forum_id=7887
>   2015: https://lists.gnu.org/archive/html/guile-user/2015-02/threads.html
>
> Time to fire up a REPL and hack!  :-)
>
> Thanks,
> Ludo’.
>
> ¹ https://lists.gnu.org/archive/html/guile-devel/2011-02/msg00173.html

Whoo whoo!  Maybe I can get out an 8sync 0.1 release by then... :)



Re: [ANN] An impudent introduction to Guile

2016-02-10 Thread Panicz Maciej Godek
:)

2016-02-09 19:41 GMT+01:00 Lawrence Bottorff :

> Good, good.
>
>
>> 3. I'm not quite convinced whether \texttt{equivalence-classes} should
>> be replaced with \textit{equivalence-classes}. If we actually decide
>> to do so, I think it would be better to replace it as
>> \textit{equivalence classes}. However, although the italics are
>> actually used to refer to new notions, and typewriter font to refer to
>> notions/functions defined in Scheme, that use case is closer to
>> mentioning, than defining -- and I thought it would fall into memory
>> easier if the reader could see that "this is actually a Scheme
>> function indeed". (This won't be obvious during the first reading, so
>> I think it would be best to put the decision off for now)
>>
>
> good . . . it's just that it bleeds into the margin (on your original pdf)
> . . . any way to correct that?
>

Now I see. I think we would need some TeXpErT to have a look. Or perhaps it
would look nicer if a space was inserted before the dash, i.e.
\texttt{equivalence -classes}. Or maybe it's not worth the trouble and your
soltion with \textit is satisfactory.


5. I think you got the "reading programs isn't like reading novels"
>> (196) opposite to my intention, which was that the programs have a
>> higher level of generality (which is rather unfamiliar) -- novels are
>> more concrete and less general.
>>
>
> Changed it to  ". . . Because of their familiar narrative specificity, we
> typically absorb stories almost effortlessly."
>

This seems fine :)

Thank you


Re: Potluck time!

2016-02-10 Thread Stefan Israelsson Tampe
Hi,

I will take on to introduce attributed variables (see swi prolog) to
minikanren. My hypothesis is that apart from the pure logical
constructs conde fresh and == all defined predicates can be constructed
with the attribute framework with no need to add extra stacks.

The idea is to maintain only two stacks S,A e.g. the normal variable stack
S and attributed stack A. All is mapping from variables
to values, for the attributed case there is no variable pointing to
variables, but resetting of values will be done and attributed value
is an assoc of type ((id1 . data1) ...) id1 contain a custom unification
predicate f : (f u v lam) that will execute before the unification of
u and v, and lam will be bound to either #f or a predicate to be executed
after the unification. The basic interface is simple. You have
(put-attr id var val)  will put a new value val in attribute data for
identity id and variable var, if the attribute does not exist create a
   new one first
(put-attr-last id var val) the same but in case  a new attribute id will be
put last (use this for attributes that does not change values, this
 is a bit more gc friendly for
attribute values that is created and then never change

(get-attr id var valout)  fetch the attribute data for identity id and
variable var, if not an attributed variable of id, fail.

There will need to be a custom printer as well in order to have a nice
printout so there need to be a little framework for that. So from this
the plan is to make all other predicates needed to construct evalo.

The nice thing about this is that attributed variables is a way to
customize condition on variables. So one does not need to proliferate the
number
of stacks. But I tend to agree that the minikanren sources are really
minimalistic and probably the use of attributed variables will make the
code much more verbose. This will be my potluck contribution.

Regards

On Wed, Feb 10, 2016 at 11:23 AM, Ludovic Courtès  wrote:

> Hello Guilers!
>
> As you may know, it’s that time of the year where we are all invited to
> prepare dishes and to bring them to the Guile birthday potluck.  This
> has become a tradition to celebrate the release of Guile 2, which took
> place on Feb. 16th¹, 5 years ago!
>
> So the idea is that you hack up something with Guile, and next Tuesday,
> on the 16th, you share your hack with people on this mailing list.
>
> Here are the fine dishes that people brought in previous years:
>
>   2012: http://savannah.gnu.org/forum/forum.php?forum_id=7111
>   2013: http://savannah.gnu.org/forum/forum.php?forum_id=7509
>   2014: http://savannah.gnu.org/forum/forum.php?forum_id=7887
>   2015: https://lists.gnu.org/archive/html/guile-user/2015-02/threads.html
>
> Time to fire up a REPL and hack!  :-)
>
> Thanks,
> Ludo’.
>
> ¹ https://lists.gnu.org/archive/html/guile-devel/2011-02/msg00173.html
>
>


Re: regex-case

2016-02-10 Thread Matt Wette

> On Feb 6, 2016, at 11:13 AM, Matt Wette  wrote:
> 
> I have always missed the ease provided by Perl in throwing a string at a list 
> of regular expressions.   I have thought it would be nice if the (ice-9 
> regex) module would provide something comparable .   So I started work on a 
> macro “regex-case”.Code attached.
> Comments on syntax appreciated. — Matt
> 

> I was thinking the above expansion has some chance (if it lives in the regex 
> module?) to memoize the make-regexp part during optimization.  

I am going to try to optimize by using eval-when and narrowing the syntax to 
use only constant strings for the case items.

I will post update if I can get it working.

Matt




eval-when not giving me what I hoped for

2016-02-10 Thread Matt Wette
I am trying to get a macro to expand at compile time using eval-when, but it’s 
not giving me what I expect:

(eval-when (expand) (make-regexp pat)) …

gets expanded to:

(if #f #f)

I would like to see something like 

#

Any help would be appreciated. — Matt

I get the same (if #f #f) result whether I use (expand) or (compile).

Below is 
1) my macro (missing the helpers all-const-string? and rx-let)
2) the macro I use to compile to il-tree and then back to scheme 
3) the demo code 
4) the output from expand

=== my macro ==
(define-syntax regexp-case
  (lambda (x)
(syntax-case x (else)
  ((_ str ((pat v ...) exp ...) ... (else else-exp ...))
   (with-syntax (((id ...) (generate-temporaries #'(pat ...
 (all-const-string? #'(pat ...))
 #'(let ((id (eval-when (expand) (make-regexp pat))) ...)
 (cond
  ((regexp-exec id str) =>
   (lambda (m) (rx-let m (v ...) exp ...)))
  ...
  (else else-exp ...)
  ((_ str ((pat v ...) exp ...) ...)
   (with-syntax (((id ...) (generate-temporaries #'(pat ...
 (all-const-string? #'(pat ...))
 #'(let ((id (eval-when (expand) (make-regexp pat))) ...)
 (cond
  ((regexp-exec id str) =>
   (lambda (m) (rx-let m (v ...) exp ...)))
  ...
  (else
   (scm-error #f "regexp-case"
  "no match found: ~S" (list str)
  #f)

=== the expand macro ===
#:use-module (srfi srfi-11)
#:use-module (system base compile)

(define* (expand-form e #:key (opts '()))
  (let-values (((exp env) (decompile
   (compile e #:from 'scheme
#:to 'tree-il
#:env (current-module))
   #:from 'tree-il
   #:to 'scheme
   #:opts opts)))
exp))

(define-syntax-rule (expand _expression_)
  (expand-form '_expression_))

=== orig test case 
  (regexp-case str
(("^([a-z]+)\\(([0-9]+)\\)$" v i)
 (list v i))
(("^([a-z]+)$" v)
 (list v "1")))

=== output from expand =

(let ((t-768 (if #f #f))
  (t-769 (if #f #f)))
  (let ((t (regexp-exec t-768 str)))
(if t
  (let ((m t))
(let ((v (match:substring m 1))
  (i (match:substring m 2)))
  (list v i)))
  (let ((t (regexp-exec t-769 str)))
(if t
  (let* ((m t) (v (match:substring m 1)))
(list v "1"))
  (scm-error
#f
"regexp-case"
"no match found: ~S"
(list str)
#f))