guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to fix an error in the pypi-importer


From: Ricardo Wurmus
Subject: Re: Trying to fix an error in the pypi-importer
Date: Sun, 03 Jan 2016 19:47:06 +0100
User-agent: mu4e 0.9.13; emacs 24.5.1

> So removing the (else -> to a comment and adjusting the parentheses did 
> not work.
>
> Could somebody point me to relevant documentation about how to write 
> conditional statements in guile?

In Scheme a conditional statement just looks like this:

  (if condition
    expression-a
    expression-b)

If the condition evaluates to “#t” then “expression-a” is evaluated.
Otherwise “expression-b” is evaluated.  “expression-a” and
“expression-b” can be something more complicated, too:

  (if (zero? number)
    ;; "then" ...
    (let ((name "swedebugia"))
      (format #t "The number was zero, ~a.\n" name))
    ;; "else" ...
    (begin
      (display "The number was not zero.")
      (display "I’m not done yet.")
      (display "Well, now I am.")))

Chapter 3 of the Guile info manual contains a useful introduction to
Scheme.

~~ Ricardo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]