Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

[ sisc-Bugs-1772170 ] make-parameter only accepts one argument: msg#00001

Subject: [ sisc-Bugs-1772170 ] make-parameter only accepts one argument
Bugs item #1772170, was opened at 2007-08-11 12:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1772170&group_id=23735

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Friedrich Delgado Friedrichs (taupan)
Assigned to: Nobody/Anonymous (nobody)
Summary: make-parameter only accepts one argument

Initial Comment:
SISC (1.16.6)
#;> (define foo (make-parameter 0 (lambda (x) (cond ((< x 0) 0) ((> x 2) 2) 
(else x)))))
Error in _make-parameter: incorrect number of arguments to procedure.
console:1:13: <from call to @srfi-39::make-parameter>
[previous entry repeated twice]
---------------------------
To enable more detailed stack tracing, set the dynamic parameter 
max-stack-trace-depth to a non-zero value, e.g. 16.
---------------------------
Some stack trace entries may have been suppressed. To see all entries set the 
dynamic parameter suppressed-stack-trace-source-kinds to '().

----

Apparently the problem is that init2.scm does contain the correct definition, 
but srfi-39.scm overwrites that with the native procedure _make-parameter which 
only accepts one argument.

When I re-evaluate the definition from init2.scm, all is well:

#;> (define (make-parameter value . converter)
  (cond [(null? converter)
         (_make-parameter value)]
            [(null? (cdr converter))
             (let ([param (_make-parameter value)]
                       [converter (car converter)])
              (lambda arg
                (if (null? arg)
                    (param)
                    (param (converter (car arg))))))]
            [else (error 'make-parameter "too many arguments.")]))

#;> (define foo (make-parameter 0 (lambda (x) (cond ((< x 0) 0) ((> x 2) 2) 
(else x)))))
#;>
(foo)
0
#;> (foo -1)
0
#;>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1772170&group_id=23735

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/


<Prev in Thread] Current Thread [Next in Thread>