unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* help with foldts*-values from (sxml fold) ?
@ 2015-05-11  2:46 Matt Wette
  2015-05-12  3:36 ` Matt Wette
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Wette @ 2015-05-11  2:46 UTC (permalink / raw)
  To: guile-user

Hi,

I'm trying to learn to use sxml currently having issues with foldts*-values.  I can't find specification of the function signatures.   I do have Andy Wingo's paper.   When I feed a tree to the routine consol-runs-3 below I get error regarding number of args to fh. call signature for fh?   Any clue what I've got wrong?  -- Matt

(define (consol-runs-3 s0)
  (letrec (;; fd: node seed ...
	   (fd (lambda (node seed vars)
		 (values node vars)))
	   ;; fu: node seed ...
	   (fu (lambda (node seed vars kseed kvars)
		 (values seed vars)))
	   ;; fh: atom seed ...
	   (fh (lambda (atom seed vars)
		 (values atom vars)))
	   )
    (foldts*-values fd fu fh s0 '() '())))

In sxml/fold.scm:
 104: 2 [foldts*-values #<procedure fd (node seed vars)> ...]
  89: 1 [fold-values #<procedure 104e4d0f0 at sxml/fold.scm:105:23 (tree . seeds)> ...]
In /.../dvP4.scm:
  21: 0 [fh elt ()]

/.../dvP4.scm:21:15: In procedure fh:
/.../dvP4.scm:21:15: Wrong number of arguments to #<procedure fh (atom seed vars)>





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help with foldts*-values from (sxml fold) ?
  2015-05-11  2:46 help with foldts*-values from (sxml fold) ? Matt Wette
@ 2015-05-12  3:36 ` Matt Wette
  2015-05-12  3:44   ` Matt Wette
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Wette @ 2015-05-12  3:36 UTC (permalink / raw)
  To: guile-user

I discovered that the return values for fd (aka fdown) should include one additional value (three in this case, not two).

On May 10, 2015, at 7:46 PM, Matt Wette <mwette@alumni.caltech.edu> wrote:

> Hi,
> 
> I'm trying to learn to use sxml currently having issues with foldts*-values.  I can't find specification of the function signatures.   I do have Andy Wingo's paper.   When I feed a tree to the routine consol-runs-3 below I get error regarding number of args to fh. call signature for fh?   Any clue what I've got wrong?  -- Matt
> 
> (define (consol-runs-3 s0)
>  (letrec (;; fd: node seed ...
> 	   (fd (lambda (node seed vars)
> 		 (values node vars)))
> 	   ;; fu: node seed ...
> 	   (fu (lambda (node seed vars kseed kvars)
> 		 (values seed vars)))
> 	   ;; fh: atom seed ...
> 	   (fh (lambda (atom seed vars)
> 		 (values atom vars)))
> 	   )
>    (foldts*-values fd fu fh s0 '() '())))
> 
> In sxml/fold.scm:
> 104: 2 [foldts*-values #<procedure fd (node seed vars)> ...]
>  89: 1 [fold-values #<procedure 104e4d0f0 at sxml/fold.scm:105:23 (tree . seeds)> ...]
> In /.../dvP4.scm:
>  21: 0 [fh elt ()]
> 
> /.../dvP4.scm:21:15: In procedure fh:
> /.../dvP4.scm:21:15: Wrong number of arguments to #<procedure fh (atom seed vars)>
> 
> 
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help with foldts*-values from (sxml fold) ?
  2015-05-12  3:36 ` Matt Wette
@ 2015-05-12  3:44   ` Matt Wette
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Wette @ 2015-05-12  3:44 UTC (permalink / raw)
  To: guile-user

>> I'm trying to learn to use sxml currently having issues with foldts*-values.  I can't find specification of the function signatures.   I do have Andy Wingo's paper.   When I feed a tree to the routine consol-runs-3 below I get error regarding number of args to fh. call signature for fh?   Any clue what I've got wrong?  -- Matt
>> 
>> (define (consol-runs-3 s0)
>> (letrec (;; fd: node seed ...
>> 	   (fd (lambda (node seed vars)
>> 		 (values node vars)))
>> 	   ;; fu: node seed ...
>> 	   (fu (lambda (node seed vars kseed kvars)
>> 		 (values seed vars)))
>> 	   ;; fh: atom seed ...
>> 	   (fh (lambda (atom seed vars)
>> 		 (values atom vars)))
>> 	   )
>>   (foldts*-values fd fu fh s0 '() '())))

Here is a copy transformation:

(define (consol-runs-3 s0)
  (letrec (
	   (fd (lambda (node seed vars)
		 (values node (list (car node)) vars)))
	   (fu (lambda (node seed vars kseed kvars)
		 (values
		  (if (null? seed)
		      (cdr (reverse kseed))
		      (cons (cdr (reverse kseed)) seed))
		  vars)))
	   (fh (lambda (atom seed vars)
		 (values (cons atom seed) vars)))
	   )
    (foldts*-values fd fu fh s0 '() '())))




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-12  3:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-11  2:46 help with foldts*-values from (sxml fold) ? Matt Wette
2015-05-12  3:36 ` Matt Wette
2015-05-12  3:44   ` Matt Wette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).