Viivi 00.09 release notes < Logs of Viivi < Viivi's Cell < Entrance
Version 00.09.00 has been improved at the following points compared to the previous version 00.08.00.
You can directly specify some objects in the S-expressions, using a command-line option
-D Nor a procedure call
(viivi-set! direct-input-objects N)where
N is a bit-summation of 1,2, and 4.
(ex.) #<procedure:let> ; built-in procedure let #<procedure:cos> ; built-in procedure cos #<constant:PI> ; Viivi-extension constant PI and so on.
#<unspecified>
#<nil>
The main purpose of introducing this option is as follows:
1> (define (func arg) (if arg 100 200)) ; a closure definition 2> (func #t) ; gives 100. No problem. 3> (define if list) ; when 'if' is overwritten 4> (func #t) ; gives (#t 100 200). Should it be 100?In such a case, the direct-input for the built-in procedure 'if' provides the work-around:
1> (define (func arg) (#<procedure:if> arg 100 200)) ; directly specified 'if' procedure 2> (func #t) ; gives 100. No problem. 3> (define if list) ; even when 'if' is overwritten 4> (func #t) ; still gives 100 as expectedYou can recover the original binding that has been modified at the top-level, as well:
1> (define cos -) 2> (cos 30) ; --> -30 'cos' became '-'! 3> (define cos #<procedure:cos>) ; recovery 4> (cos 30) ; --> 0.15425144988758405 ; back to the original behavior of cos
Viivi 00.09 release notes < Logs of Viivi < Viivi's Cell < Entrance
Exhibited on 2011/08/10
Updated on 2022/03/02
Copyright(C) 2003-2022 ilma <ilma@viivi.io> All rights reserved.