# Confused on excerise on htdp

**URL:** https://racket.discourse.group/t/confused-on-excerise-on-htdp/768
**Category:** Questions & Answers
**Tags:** question, drracket, creative-racket
**Created:** [March 5, 2022, 12:15pm UTC](https://racket.discourse.group/t/confused-on-excerise-on-htdp/768 "2022-03-05T12:15:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![osman44](https://avatars.discourse-cdn.com/v4/letter/o/85f322/32.png) [@osman44](https://racket.discourse.group/u/osman44)
#### Post date: [March 5, 2022, 12:15pm UTC](https://racket.discourse.group/t/confused-on-excerise-on-htdp/768/1 "2022-03-05T12:15:08Z")

</div>

i am struggling to understand this question

Exercise 15. Define ==\>. The function consumes two Boolean values, call them sunny and friday. Its answer is #true if sunny is false or friday is true. Note Logicians call this Boolean operation implication, and they use the notation sunny =\> friday for this purpose.

is it asking me to run a variable becuase for a function i would need a parameter to run but in my case it cant be used as its only checking wether something is true or false,here is my code

```scheme
(define ==> (if (not( or (boolean? sunny #false) (boolean? friday #true) #true))))

```

---

<div class="post-metadata">

### Author: ![simonls](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/simonls/32/170_2.png) [@simonls](https://racket.discourse.group/u/simonls)
#### Post date: [March 5, 2022, 2:20pm UTC](https://racket.discourse.group/t/confused-on-excerise-on-htdp/768/2 "2022-03-05T14:20:07Z")

</div>

What does the exercise want you to do?

What is `boolean?` what does it expect as input, what is its output?  
What are functions ending with a question mark `?` called?  
Here is where functions are first introduced: [Prologue: How to Program](https://htdp.org/2018-01-06/Book/part_prologue.html#%28part._some-i%2Fo%29)

* * *

In general it seems you have skipped parts of the book and it is difficult to help you, because I don't know which parts you may have skipped. And me giving you the solution wouldn't help you in learning.

To make it easier to **help us, help you** , you should follow the **design-recipe** :  
[I Fixed-Size Data: 3.1 Designing Functions](https://htdp.org/2021-11-15/Book/part_one.html#(part._sec~3adesign-func))

This way it is **easier for other people** reading your code _to recognize what parts you already understand and which parts you need guidance with_.

**Following the design recipe is also for yourself** , because it structures a task in a way that **causes you to get clear** about what you are trying to accomplish and **it gives you a clear structure to follow** ,  
_this allows you to reach the goal incrementally, avoiding confusion_.

In general I advise you to go back to the beginning and see what parts you need to re-read, because there are definitely parts you have skipped, **those skipped parts now cause your confusion**.

* * *

Too be a bit more cheeky 😛: if you can't be bothered to follow the design recipe, then I can't be bothered to answer any more questions. (I am a volunteer and a lot of other people here are...)

Why? Because it is not productive if I replicate what **How to Design Programs** teaches, spread across a lot of different help topics.

If I can see that you can do what the book wants you to do:  
**follow the design recipe** and you still need help, then I am more inclined to spend my free time, volunteering to help someone.

There is a reason why netiquette is a thing, because with it, it is more likely that people want to answer.  
Within the context of **How to Design Programs** you should follow the design recipe.

---

<div class="post-metadata">

### Author: ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)
#### Post date: [March 6, 2022, 4:29am UTC](https://racket.discourse.group/t/confused-on-excerise-on-htdp/768/3 "2022-03-06T04:29:26Z")

</div>

Osman, it sounds like you might be confused about what a _function_ is. I blame your math teachers. It may be that they told you that a function is exclusively a thing that takes in numbers. That's not true! Functions can also take in booleans, and return them. This is an example of a function that takes in booleans, and returns one. Does that help you?

---

<div class="post-metadata">

### Author: ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)
#### Post date: [March 6, 2022, 10:43am UTC](https://racket.discourse.group/t/confused-on-excerise-on-htdp/768/4 "2022-03-06T10:43:08Z")

</div>

> [@osman44](#):
>
> The function consumes two Boolean values, call them sunny and friday. I

This phrase means your functions starts like this:

```scheme
(define (==> sunny friday)
   your_computation_here )

```
