From 9a31b6d8cd48dc1e05cd1287dc4b87dbd1d97a9e Mon Sep 17 00:00:00 2001 From: Sigilante <57601680+sigilante@users.noreply.github.com> Date: Tue, 13 Jun 2023 12:38:21 -0500 Subject: [PATCH] Update Q-func.md --- content/guides/core/hoon-school/Q-func.md | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/content/guides/core/hoon-school/Q-func.md b/content/guides/core/hoon-school/Q-func.md index 7d7d65ed..4a6651eb 100644 --- a/content/guides/core/hoon-school/Q-func.md +++ b/content/guides/core/hoon-school/Q-func.md @@ -114,30 +114,16 @@ q=15 120 ``` -### Exercise: Calculate a Factorial - -- Use `++reel` to produce a gate which calculates the factorial of a number. - - -## Aside on Wet Gates - -If you've already encountered [wet gates](/guides/core/hoon-school/R-metals) and how they handle their sample, you may eventually circle back around to attempting to write statements which curry a wet gate. For instance, here is an attempt to curry `++reel` which itself takes a gate (in this case `++add`) as an argument: +If you've already encountered [wet gates](/guides/core/hoon-school/R-metals) and how they handle their sample, you may eventually circle back around to attempting to write statements which curry a wet gate. For instance, here we curry `++reel` which itself takes a gate (in this case `++add`) as an argument: ```hoon > ((curr reel add) `(list @)`[1 2 3 4 ~]) -mull-grow --find.i.a -dojo: hoon expression failed +10 ``` -Unfortunately, `++cury` and `++curr` don't work with wet gates, and you'll see a `mull-grow` error. - -One solution is to “dry out” the wet gate using [`++bake`](/reference/hoon/stdlib/2b#bake): +### Exercise: Calculate a Factorial -```hoon -> ((curr (bake reel ,[(list @) _add]) add) `(list @)`[1 2 3 4 ~]) -10 -``` +- Use `++reel` to produce a gate which calculates the factorial of a number. ## Classic Operations