# Specialization patch not found

**URL:** <https://forum.xod.io/t/specialization-patch-not-found/2771>\
**Category:** Uncategorized\
**Created:** [November 5, 2019, 6:16am UTC](https://forum.xod.io/t/specialization-patch-not-found/2771 "2019-11-05T06:16:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamthevector](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@iamthevector](https://forum.xod.io/u/iamthevector)\
**Post date:** [November 5, 2019, 6:16am UTC](https://forum.xod.io/t/specialization-patch-not-found/2771/1 "2019-11-05T06:16:17Z")

</div>

Specialization patch not found

Trying to use switch-case, the logic is.

Blink the led wih T1 when notthing happens  
Blink the led with T0.5 when Button 1 is pressed

But as you can see it’s giving me an odd error i cannot get. Any help?

 ![74841529_10156669947002322_5845738265549733888_o](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/4/4e8ea8c75c09c77e1d7ef52b5118e4ed3249cb07.jpeg)

---

<div class="post-metadata">

**Author:** ![gabbapeople](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gabbapeople/32/1517_2.png) [@gabbapeople](https://forum.xod.io/u/gabbapeople)\
**Post date:** [November 5, 2019, 9:26am UTC](https://forum.xod.io/t/specialization-patch-not-found/2771/2 "2019-11-05T09:26:20Z")

</div>

Hi! [iamthevector](https://forum.xod.io/u/iamthevector)  
It is not necessary to use the switch case construction in the presence of a single condition.  
In my opinion, the task is easily solved without using the `switch-case`. Like this:

![blink](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/6/62ddb10a41a2a390f3f975010fdc09738bc23e1d.png)

Inside, the `switch-case` compares the input pin `IN` value with values at the `X1`, `X2`, `X3` pins, using the generic `equal` node. For the `equal` the boolean specialization is not necessary as the Boolean can only be either `0` or `1`. It’s a bit illogical.

Still, if you want to use the `switch-case` try to get rid of the boolean type.  
Like this:

 ![blink3](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/1/1727818a354c86fcb15acdc9fcc77907b2d6fcb3.png)

---

<div class="post-metadata">

**Author:** ![iamthevector](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@iamthevector](https://forum.xod.io/u/iamthevector)\
**Post date:** [November 5, 2019, 11:48am UTC](https://forum.xod.io/t/specialization-patch-not-found/2771/3 "2019-11-05T11:48:59Z")

</div>

Yes i posted just a 1 condition switch case just for example purposes, but the final software should have more behaviour.

So the problem is that the switch-case method is just for numbers and not booleans? This should be explicited in the switch-case page that tell the users that the switch-case has generic input. This is not true and misleading.

[https://xod.io/libs/xod/core/switch-case](https://xod.io/libs/xod/core/switch-case)

Thanks for the help

---

<div class="post-metadata">

**Author:** ![evgenykochetkov](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/evgenykochetkov/32/14_2.png) [@evgenykochetkov](https://forum.xod.io/u/evgenykochetkov)\
**Post date:** [November 5, 2019, 1:37pm UTC](https://forum.xod.io/t/specialization-patch-not-found/2771/4 "2019-11-05T13:37:57Z")

</div>

So do you want to expand it something like this?

![09](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/9e2fb29bc86822f2053263e8e74304d37becf3b5.png)

As a quick solution, you can provide the missing implementation yourself.  
Create a patch named `equal(boolean)`, copy the insides of `equal(byte)` into it, and replace byte inputs with boolean inputs. In the end, it should look like this:  
 ![54](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/901efd6ac842343c6e5f277a0f5dd3297328d8d3.png)

We should probably add `equal(boolean)` in the future release, as it could be useful in many other cases as well.

---

<div class="post-metadata">

**Author:** ![iamthevector](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@iamthevector](https://forum.xod.io/u/iamthevector)\
**Post date:** [November 5, 2019, 2:29pm UTC](https://forum.xod.io/t/specialization-patch-not-found/2771/6 "2019-11-05T14:29:38Z")

</div>

Nice, that’s a good solution. But what should i write inside the not-implemented block?

---

<div class="post-metadata">

**Author:** ![evgenykochetkov](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/evgenykochetkov/32/14_2.png) [@evgenykochetkov](https://forum.xod.io/u/evgenykochetkov)\
**Post date:** [November 6, 2019, 1:14pm UTC](https://forum.xod.io/t/specialization-patch-not-found/2771/7 "2019-11-06T13:14:06Z")

</div>

> But what should i write inside the not-implemented block?

The implementation from `equal(byte)` will work perfectly fine. In fact, if you actually _copy_ the insides of `equal(byte)` (I mean literally select the nodes, copy and paste, not recreate from scratch), the C++ implementation associated with `not-implemented-in-xod` node will be copied as well, so you don’t have to write anything 🙂

Or you can throw away the `not-implemented-in-xod` node and use `xor` and `not`:  
 ![47](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/5/5f5e1cd9ea1032cc23b089b757a1bc6d4c3e43f4.png)
