Kooda | 29 Mar 00:50 2015

rest-bind request headers support

Hi,

I’m trying to use rest-bind for a project and need to be able to add
some headers to the http requests, which rest-bind didn’t permit, even
when passing a request object.

Here is a simple patch that fixes this issue:

--- rest-bind.scm.orig	2015-03-29 00:26:49.000000000 +0100
+++ rest-bind.scm	2015-03-29 00:24:43.000000000 +0100
 <at>  <at>  -94,7 +94,9  <at>  <at> 
 				       (else (uri-reference uri/req))))
 			(method  (cond ((request? uri/req) (request-method uri/req))
 				       (writer 'POST)
-				       (else 'GET))))
+				       (else 'GET)))
+			(headers (cond ((request? uri/req) (request-headers uri/req))
+				       (else (headers '())))))
 		   (lambda ,proc-args
 		     (let* (, <at> (if (not (null? uri-args))
 			      `((uri (update-uri uri path: (append (uri-path uri) (map ->string (list , <at> uri-args)))))
 <at>  <at>  -109,7 +111,7  <at>  <at> 
 												     ,param)))
 										  params))))))
 				   '())
-			   (req (make-request uri: uri method: method)) ; poke the args into query string.
+			   (req (make-request uri: uri method: method headers: headers)) ; poke the args into query string.
 			   )
 		       (receive (reader uri response)
 				(call-with-input-request req ,(if writer '(writer body) #f) ,reader)
(Continue reading)

Andy Bennett | 27 Mar 13:37 2015

Fwd: Re: headers with nginx + awful

Is this thing on?
I seem to be having trouble posting this.

-------- Forwarded Message --------
Subject: Re: [Chicken-users] headers with nginx + awful
Date: Tue, 24 Mar 2015 22:13:11 +0000
From: Andy Bennett <andyjpb <at> ashurst.eu.org>
To: Nathaniel Rudavsky-Brody <nathaniel <at> studio.cm>

Hi,

Given that it's happening with Firefox but not with Curl, I'd look into
the connection reuse between nginx and spiffy.

Curl always opens a new http connection: Firefox might reuse one that it
has around already.

Does this happen only on not-the-first-request?

Sorry to top post.

> I'm having a problem with headers when using nginx's proxy_pass with
> awful, and I'm not sure if it's a question of nginx or Chicken, or just
> my misunderstanding of headers...
> 
> Everything works fine except when I use (send-static-file) as in:
> 
> (define-page (regexp "/file/.+")
>   (lambda (url)
>       (parameterize ((root-path (data-dir)))
(Continue reading)

Matt Gushee | 27 Mar 03:53 2015
Picon

Basic abnf usage?

Hello--

I'm attempting to learn how to use the abnf egg, but I'm having some difficulties.

First of all, I think the example needs to be updated. It uses the 'lit' matcher, which requires 'abnf-charlist' to be imported; also, the 'fws' and 'cfws' symbols are not defined. It's not hard to define them if you know the grammar, but given that this is the only example for the egg, it would be nice if it were a complete working example.

However, the greater challenge for me is understanding how to use the parsing rules once you have defined them. Since there is apparently no 'parse' function, I have no idea what to do. Is it necessary to define one's own parser? If so, what arguments does it need to take, and what does it return?

Thanks for any info.

--
Matt Gushee
_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Andy Bennett | 26 Mar 15:12 2015

Fwd: Re: headers with nginx + awful


-------- Forwarded Message --------
Subject: Re: [Chicken-users] headers with nginx + awful
Date: Tue, 24 Mar 2015 22:13:11 +0000
From: Andy Bennett <andyjpb <at> ashurst.eu.org>
To: Nathaniel Rudavsky-Brody <nathaniel <at> studio.cm>

Hi,

Given that it's happening with Firefox but not with Curl, I'd look into
the connection reuse between nginx and spiffy.

Curl always opens a new http connection: Firefox might reuse one that it
has around already.

Does this happen only on not-the-first-request?

Sorry to top post.

> I'm having a problem with headers when using nginx's proxy_pass with
> awful, and I'm not sure if it's a question of nginx or Chicken, or just
> my misunderstanding of headers...
> 
> Everything works fine except when I use (send-static-file) as in:
> 
> (define-page (regexp "/file/.+")
>   (lambda (url)
>       (parameterize ((root-path (data-dir)))
>           (send-static-file (string-drop url 6)))))
> 
> In this case, Firefox shows me a set of Spiffy headers at the end of the
> response body, even though they should be replaced by nginx's headers,
> which seem to be fine:
> 
> <html>
>   ...
> </html>
> HTTP/1.1 200 OK
> Content-Type: text/html
> Server: Spiffy/5.3 (Running on Chicken 4.8.0.6)
> Content-Length: 6
> Date: Tue, 24 Mar 2015 16:01:46 GMT
> 
> 483702
> 
> Curl, however, only sees the nginx headers, with nothing extra at the end:
> 
> HTTP/1.1 200 OK
> Server: nginx/1.4.6 (Ubuntu)
> Date: Tue, 24 Mar 2015 16:24:42 GMT
> Content-Type: text/html
> Content-Length: 483704
> Connection: keep-alive
> Last-Modified: Tue, 24 Mar 2015 16:23:40 GMT
> Etag: "483704-1427214220.0"
> 
> <html>
>   ...
> </html>
> 
> My nginx config is just:
> 
>     server {
>           listen        7000;
>           location / {
>                    proxy_pass http://localhost:8080;
> 
>           }
>         }
> 
> Many thanks for any ideas.
> 
> Nathaniel
> 
> 
> 
> 
> 
> _______________________________________________
> Chicken-users mailing list
> Chicken-users <at> nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
> 

Regards,
 <at> ndy

-- 
andyjpb <at> ashurst.eu.org
http://www.ashurst.eu.org/
0290 DA75 E982 7D99 A51F  E46A 387A 7695 7EBA 75FF

Regards,
 <at> ndy

--

-- 
andyjpb <at> ashurst.eu.org
http://www.ashurst.eu.org/
0290 DA75 E982 7D99 A51F  E46A 387A 7695 7EBA 75FF
Peter Sommerfeld | 26 Mar 13:03 2015
Picon

setup-download

Hi everyone!

I am new to scheme and chicken. I have installed 4.9.0.1 on DragonflyBSD
using pkg. First simple tests show that it works.

I have set the environment in .tcshrc
     setenv CHICKEN_REPOSITORY $HOME/eggs/lib/chicken/4

and called:
     chicken-install -init ~/eggs/lib/chicken/4

I get the following error message:
     Error (require) cannot load extention: setup-download

The same happens with chicken-install arrays and others.
I have tried it as root too.

I think I've missed something when installing but cannot find a 
reference. What is wrong here and what has to be done.

Peter
Nathaniel Rudavsky-Brody | 24 Mar 17:29 2015

headers with nginx + awful

Hello,

I'm having a problem with headers when using nginx's proxy_pass with awful, and I'm not sure if it's a question of nginx or Chicken, or just my misunderstanding of headers...

Everything works fine except when I use (send-static-file) as in:

(define-page (regexp "/file/.+")
  (lambda (url)
      (parameterize ((root-path (data-dir)))
          (send-static-file (string-drop url 6)))))

In this case, Firefox shows me a set of Spiffy headers at the end of the response body, even though they should be replaced by nginx's headers, which seem to be fine:

<html>
  ...
</html>
HTTP/1.1 200 OK
Content-Type: text/html
Server: Spiffy/5.3 (Running on Chicken 4.8.0.6)
Content-Length: 6
Date: Tue, 24 Mar 2015 16:01:46 GMT

483702

Curl, however, only sees the nginx headers, with nothing extra at the end:

HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 24 Mar 2015 16:24:42 GMT
Content-Type: text/html
Content-Length: 483704
Connection: keep-alive
Last-Modified: Tue, 24 Mar 2015 16:23:40 GMT
Etag: "483704-1427214220.0"

<html>
  ...
</html>

My nginx config is just:

    server {
          listen        7000;
          location / {
                   proxy_pass http://localhost:8080;

          }
        }

Many thanks for any ideas.

Nathaniel



_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Christopher Collins | 19 Mar 20:21 2015
Picon

GC root gets garbage collected

Hello Chicken users,

I'm struggling with an issue where a scheme object is being unexpectedly
garbage collected.

To provide some context: my program's main() is in C, and the C code calls out
to scheme procedures.  One of these scheme procedures makes and returns a
struct (via the defstruct extension).  I attempt to store the resulting struct
in a gc root, but the struct gets garbage collected anyway, at some
indeterminate time in the future.  Here is what my code (basically) looks like:

;;;; mystruct.scm

(require-extension defstruct)
(defstruct mystruct foo)

(define-external (new_mystruct ()) scheme-object
  (make-mystruct))

/* mystruct.c */

void *
build_mystruct(void)
{
    C_word mystruct;
    void *root;

    root = CHICKEN_new_gc_root();
    mystruct = new_mystruct();
    CHICKEN_gc_root_set(root, mystruct);
    return root;
}

The way I understood it, the returned "mystruct" instance would never get
garbage collected until I explicitly call CHICKEN_delete_gc_root().  I never
actually delete the root (I set a breakpoint on CHICKEN_delete_gc_root in gdb,
just to be sure), but the object gets garbage collected anyway.  The next time
I try to pass the instance of mystruct to a scheme procedure, the procedure
fails because the argument is not of the expected type (when I print the
argument, I see " #<invalid forwarded object>").

I must be confused about how gc roots work.  Am I doing anything that is
obviously wrong?  I can try to post some real code if that would help.

All responses appreciated.

Thanks,
Chris
Peter Achten | 18 Mar 10:51 2015
Picon

[TFP'15] final call for papers - deadline extended march 31 -

                         -----------------------------
                     L A S T    A L L   F O R   P A P E R S
                         -----------------------------

                         ======== TFP 2015 ===========

               16th Symposium on Trends in Functional Programming
                                June 3-5, 2015
                        Inria Sophia Antipolis, France
                           http://tfp2015.inria.fr/

The symposium on Trends in Functional Programming (TFP) is an
international forum for researchers with interests in all aspects of
functional programming, taking a broad view of current and future
trends in the area. It aspires to be a lively environment for
presenting the latest research results, and other contributions (see
below). Authors of draft papers will be invited to submit revised
papers based on the feedback receive at the symposium.  A
post-symposium refereeing process will then select a subset of these
articles for formal publication.

The selected revised papers will be published as a Springer Lecture
Notes in Computer Science (www.springer.com/lncs) volume.

TFP 2015 will be the main event of a pair of functional programming
events. TFP 2015 will be accompanied by the International Workshop on
Trends in Functional Programming in Education (TFPIE), which will take
place on June 2nd.

The TFP symposium is the heir of the successful series of Scottish
Functional Programming Workshops. Previous TFP symposia were held in
   * Edinburgh (Scotland) in 2003;
   * Munich (Germany) in 2004;
   * Tallinn (Estonia) in 2005;
   * Nottingham (UK) in 2006;
   * New York (USA) in 2007;
   * Nijmegen (The Netherlands) in 2008;
   * Komarno (Slovakia) in 2009;
   * Oklahoma (USA) in 2010;
   * Madrid (Spain) in 2011;
   * St. Andrews (UK) in 2012;
   * Provo (Utah, USA) in 2013;
   * and in Soesterberg (The Netherlands) in 2014.
For further general information about TFP please see the TFP homepage.
(http://www.tifp.org/).

== INVITED SPEAKERS ==

TFP is pleased to announce talks by the following two invited speakers:

   * Laurence Rideau is a researcher at INRIA and is interested in the
     semantics of programming languages , the formal methods, and the
     verification tools for programs and mathematical proofs.  She
     participated in the beginnings of the Compcert project (certified
     compiler), and is part of the Component Mathematical team in the
     MSR-INRIA joint laboratory, who performed the formalization of the
     Feit-Thompson theorem successfully.

     Thirty years ago, computers barged in mathematics with the famous
     proof of the Four Color Theorem.  Initially limited to simple
     calculation, their role is now expanding to the reasoning whose
     complexity is beyond the capabilities of most humans, as the proof of
     the classification of finite simple groups.  We present our large
     collaborative adventure around the formalization of the Feit-Thompson
     theorem (http://en.wikipedia.org/wiki/Feit%E2%80%93Thompson_theorem)
     that is a first step to the classification of finite groups
     and that uses a palette of methods and techniques that range from
     formal logic to software (and mathematics) engineering.

   * Anil Madhavapeddy

== SCOPE ==

The symposium recognizes that new trends may arise through various
routes.  As part of the Symposium's focus on trends we therefore
identify the following five article categories. High-quality articles
are solicited in any of these categories:

     Research Articles: leading-edge, previously unpublished research work
     Position Articles: on what new trends should or should not be
     Project Articles: descriptions of recently started new projects
     Evaluation Articles: what lessons can be drawn from a finished project
     Overview Articles: summarizing work with respect to a trendy subject

Articles must be original and not simultaneously submitted for
publication to any other forum. They may consider any aspect of
functional programming: theoretical, implementation-oriented, or
experience-oriented.  Applications of functional programming
techniques to other languages are also within the scope of the
symposium.

Topics suitable for the symposium include:

     Functional programming and multicore/manycore computing
     Functional programming in the cloud
     High performance functional computing
     Extra-functional (behavioural) properties of functional programs
     Dependently typed functional programming
     Validation and verification of functional programs
     Debugging and profiling for functional languages
     Functional programming in different application areas:
       security, mobility, telecommunications applications, embedded 
systems,
       global computing, grids, etc.
     Interoperability with imperative programming languages
     Novel memory management techniques
     Program analysis and transformation techniques
     Empirical performance studies
     Abstract/virtual machines and compilers for functional languages
     (Embedded) domain specific languages
     New implementation strategies
     Any new emerging trend in the functional programming area

If you are in doubt on whether your article is within the scope of
TFP, please contact the TFP 2015 program chair, Manuel Serrano.

== BEST PAPER AWARDS ==

To reward excellent contributions, TFP awards a prize for the best paper
accepted for the formal proceedings.

TFP traditionally pays special attention to research students,
acknowledging that students are almost by definition part of new
subject trends. A student paper is one for which the authors state
that the paper is mainly the work of students, the students are listed
as first authors, and a student would present the paper. A prize for
the best student paper is awarded each year.

In both cases, it is the PC of TFP that awards the prize.  In case the
best paper happens to be a student paper, that paper will then receive
both prizes.

== SPONSORS ==

TFP is financially supported by Erlang Solutions.

== PAPER SUBMISSIONS ==

Acceptance of articles for presentation at the symposium is based on a
lightweight peer review process of extended abstracts (4 to 10 pages
in length) or full papers (20 pages). The submission must clearly
indicate which category it belongs to: research, position, project,
evaluation, or overview paper. It should also indicate which authors
are research students, and whether the main author(s) are students.  A
draft paper for which ALL authors are students will receive additional
feedback by one of the PC members shortly after the symposium has
taken place.

We use EasyChair for the refereeing process. Papers must be submitted at:

   https://easychair.org/conferences/?conf=tfp2015

Papers must be written in English, and written using the LNCS
style. For more information about formatting please consult the
Springer LNCS web site:

   http://www.springer.com/computer/lncs?SGWID=0-164-6-793341-0

== IMPORTANT DATES ==

Submission of draft papers:     March 31, 2015
Notification:                   April 7, 2015
Registration:                   May 4, 2015
TFP Symposium:                  June 3-5, 2015
Student papers feedback:        June 9, 2015
Submission for formal review:   July 1, 2015
Notification of acceptance:     September 8, 2015
Camera ready paper:             October 8, 2015

== PROGRAM COMMITTEE ==

Janis Voigtländer               University of Bonn, DE
Scott Owens                     University of Kent, UK
Neil Sculthorpe                 Swansea University, UK
Colin Runciman                  University of York, UK
Manuel Serrano                  Inria (PC chair), FR
Rinus Plasmeijer                University of Nijmegen, NL
Tomas Petricek                  University of Cambridge, UK
Marco T. Morazan                Seton Hall University, USA
Wolfgang De Meuter              Vrije Universiteit Brussel, BE
Michel Mauny                    Ensta ParisTech, FR
Sam Lindley                     The University of Edinburgh, UK
Daan Leijen                     Microsoft, USA
Jurriaan Hage                   Utrecht University, NL
Andy Gill                       University of Kansas, USA
Thomas Gazagnaire               University of Cambrige, UK
Lars-Ake Fredlund               Universidad Politécnica de Madrid, ES
Jean-Christophe Filliatre       Université Paris Sud Orsay, FR
Marc Feeley                     Université de Montréal, CA
Olaf Chitil                     University of Kent, UK
Edwin Brady                     University of St Andrews, UK

_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Matt Gushee | 17 Mar 04:27 2015
Picon

Cryptic SSAX error message

Hello, all--

OK, first of all, I have not forgotten that the SXML tools are full of black magic, etc. - no need to rehash that discussion. And so if it is not deemed feasible to fix the misbehavior I'm seeing, so be it. But I couldn't let this pass without saying something.

I was building a new blog with Coq au vin, which uses Civet to process templates, which in turn uses SSAX ... and one of my XHTML templates caused the following error:

csi> (load-template "base.html")

Warning: DOCTYPE DECL html http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd found and skipped
Error: XMLNS [4] for '
#\=
"'"

    Call history:

    civet-impl.scm:84: *template-path*     
    civet-impl.scm:439: make-pathname     
    civet-impl.scm:440: pathname-replace-extension     
    civet-impl.scm:441: template-cache-path     
    civet-impl.scm:88: *template-cache-path*     
    civet-impl.scm:89: template-path     
    civet-impl.scm:84: *template-path*     
    civet-impl.scm:89: make-pathname     
    civet-impl.scm:441: make-pathname     
    civet-impl.scm:442: update-cached-template?     
    civet-impl.scm:428: file-exists?     
    civet-impl.scm:429: file-exists?     
    civet-impl.scm:430: file-modification-time     
    civet-impl.scm:431: file-modification-time     
    civet-impl.scm:444: open-input-file     
    civet-impl.scm:447: ssax:xml->sxml          <--

This is obviously not very informative - but more than that, I found it misleading, because it refers to 'XMLNS [4]' - so I thought at first there was an error related to a namespace. That was not the case, as you'll see.

Fortunately, I kept a cool head and decided to check the file with xmlwf. Here's what that told me:

  $ xmlwf base.html
  base.html:16:17: not well-formed (invalid token)

Now that's a helpful error message. It turns out the problem was the inline JavaScript in my template (which contained the <= operator). Since I was using the XHTML Transitional doctype, that's allowed per W3C specs, and it simply hadn't occurred to me that it was likely to result in non-well-formed XML.

I think someone who doesn't have extensive experience with XML and/or is trying to parse a file they did not create themselves might have no idea what to do with that SSAX error.

--
Matt Gushee
_______________________________________________
Chicken-users mailing list
Chicken-users <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users
Sascha Ziemann | 15 Mar 22:41 2015
Picon

Fwd: Chicken on Solaris

Hello,

the solution setting INSTALL_PROGRAM works fine for me.

Regards,
Sascha

---------- Forwarded message ----------
From: Michele La Monaca <mikele.chicken <at> lamonaca.net>
Date: 2015-03-13 21:18 GMT+01:00
Subject: Re: [Chicken-users] Chicken on Solaris
To: Sascha Ziemann <ceving <at> gmail.com>

Hi Sascha,

glad to know it helped.

Can you send your reply also to the mailing list in order to share
your (positive) experience with this workaround?

Thanks,
Michele

On Fri, Mar 13, 2015 at 2:24 PM, Sascha Ziemann <ceving <at> gmail.com> wrote:
> 2015-03-12 17:33 GMT+01:00 Michele La Monaca <mikele.chicken <at> lamonaca.net>:
>> make PLATFORM=solaris INSTALL_PROGRAM=/usr/ucb/install install
>
>
> Thanks! This helps. Although I had to use gmake.
>
> Regards,
> Sascha
Sascha Ziemann | 12 Mar 16:59 2015
Picon

Chicken on Solaris

I tried to install Chicken on Solaris. Compilation works fine but
installation fails:

$ gmake PLATFORM=solaris PREFIX=$HOME/chicken install
"gmake" -f ./Makefile.solaris CONFIG= install
gmake[1]: Entering directory `/export/home/x/chicken-4.9.0.1'
install -d -m 755 "/export/home/x/chicken/lib"
directory /export/home/x/chicken/lib created
ginstall -m 755 libchicken.so "/export/home/x/chicken/lib/libchicken.so.7"
/bin/sh: ginstall: not found
gmake[1]: *** [install-libs] Error 1
gmake[1]: Leaving directory `/export/home/x/chicken-4.9.0.1'
gmake: *** [install] Error 2

It seems to me that configure has missed to check for ginstall.

$ type ginstall
-bash: type: ginstall: not found

I tried Solaris 10:

$ uname -a
SunOS xxxxxxxx 5.10 Generic_150400-04 sun4v sparc SUNW,SPARC-Enterprise-T5120

Gmane