# Signature types

**URL:** <https://racket.discourse.group/t/signature-types/2226>\
**Category:** Questions & Answers\
**Created:** [August 17, 2023, 9:49pm UTC](https://racket.discourse.group/t/signature-types/2226 "2023-08-17T21:49:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahsatan](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ahsatan/32/1386_2.png) [@ahsatan](https://racket.discourse.group/u/ahsatan)\
**Post date:** [August 17, 2023, 9:49pm UTC](https://racket.discourse.group/t/signature-types/2226/1 "2023-08-17T21:49:44Z")

</div>

Hello!

I'm playing around with the newish [Signatures](https://docs.racket-lang.org/htdp-langs/beginner-abbr.html?q=signatures#%28form._%28%28lib._lang%2Fhtdp-beginner-abbr..rkt%29._signature%29%29) feature on some very simple code and am not sure if this isn't expected to work yet (I read it's experimental in the previous patch) or I'm doing something wrong:

> (require 2htdp/image)
> 
> (: image-area (Image -\> Number))
> 
> (define (image-area i) 0) ; stub

The Interactions window shows this error:

> Image: this variable is not defined

I have also tried subbing "Rectangle" or "image" for Image with the same error. I have successfully used this syntax with, for example, a Number -\> Number function.

Any insight?

Thanks!

---

<div class="post-metadata">

**Author:** ![EmEf](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@EmEf](https://racket.discourse.group/u/EmEf)\
**Post date:** [August 17, 2023, 10:18pm UTC](https://racket.discourse.group/t/signature-types/2226/2 "2023-08-17T22:18:51Z")

</div>

```plaintext
#lang htdp/isl

;; import, with signature 
(require 2htdp/image)
(define Image (signature (predicate image?)))

;; define function 
(: f (Image -> Number))
(define f (λ (i) 0))

;; experiment 
(f empty-image)
(f 2)

```

— It turns out that you need to create signatures from properties — which we didn’t do for the image libs when we shifted signatures to the \*SL languages.  
— Since BSL and BSL+ do not come with higher-order functions, the above won’t work in those languages for now. Time permitting we will figure out a work-around for 8.11 or up.

---

<div class="post-metadata">

**Author:** ![ahsatan](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ahsatan/32/1386_2.png) [@ahsatan](https://racket.discourse.group/u/ahsatan)\
**Post date:** [August 18, 2023, 12:20am UTC](https://racket.discourse.group/t/signature-types/2226/3 "2023-08-18T00:20:05Z")

</div>

Thank you so much for taking the time to help! That worked perfectly as a workaround :).
