Can you return a value in the Scheme that will not be printed in the list?

I am trying to return an invisible value to a circuit function, but it seems like it cannot get anything that WONT will print on the screen, and that is what I need. Is there a value in the schema that can be added to the list that will not be printed when called (displayed)?

+4
source share
2 answers

Instead of trying to create an invisible type, why don't you use a filter to define and delete values ​​that you don’t want to create so that the new list can do whatever you like, such as printing on the screen.

(define (want-this? thing) ;; write a function that takes one ;; parameter and returns a boolean ;; true if you want it ;; false if you don't ) (filter want-this? '(values)) 

Also see the docs: http://docs.racket-lang.org/reference/pairs.html?q=filter#%28def._%28%28lib._racket/private/base..rkt%29._filter%29 % 29

+1
source

There is no standard way to do this. You can override the display procedure (or any other output on your circuit) so that it does not print objects of a specific type.

 (define display-old display) (define (display obj) (if (not (invisible? obj)) (display-old obj))) 
0
source

All Articles