6ferrets (6ferrets) wrote in lisp,
6ferrets
6ferrets
lisp

(Novice) How to do nothing in Scheme?

I'm teaching myself some Scheme using PLT Scheme and have been using it to write some scripts. Because Scheme isn't purely functional, I ran into a situation where I wanted the option of doing "nothing". In my mind, it looked something like this:
(if (eof-object? x)
  (do-nothing)
  (display message) )

PLT Scheme requires that (if ...) must have an else clause, which seems to be non-standard.

In my working version, (do-nothing) is replaced by (display ""). (begin) is illegal. '() gets displayed on screen, which I don't want.

Am I not thinking Lispily (or Schemingly) enough, or is there some way to tell PLT Scheme to do nothing and to move along?



P.S. Oh no—another learning experience! :-) Thanks, everyone.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 8 comments