Opened 2 years ago

Last modified 18 months ago

#1235 new defect

Issue with parameters

Reported by: mario Owned by:
Priority: major Milestone: someday
Component: core libraries Version: 4.10.x
Keywords: parameters, make-parameter Cc: initerm@…
Estimated difficulty: medium


Reported by Joo ChurlSoo? via e-mail:

(c) 2008-2015, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.10.0 (rev b259631)
windows-mingw32-x86 [ manyargs dload ptables ]
compiled 2015-08-04 on (Linux)
#;1> (define a (make-parameter 1))
#;2> (a 10 23)
#;3> (a)
#;4> (define b (make-parameter 2 number->string))
#;5> (b 20 23)
#;6> (b)
#;7> (b 20)
#;8> (b)

Change History (2)

comment:1 Changed 2 years ago by sjamaan

This happens because parameterize expands to a call that passes #t or #f as a second argument to the parameter procedure, depending on whether the converter needs to be invoked.

We can never truly hide this, because the macro expands to code at the call site, which means whatever it expands to needs to be accessible to the user.

See also my suggestion in #1227 to make the second argument a keyword. This would make the problem less likely.

comment:2 Changed 18 months ago by sjamaan

  • Estimated difficulty set to medium
Note: See TracTickets for help on using tickets.