laurent.orseau
2020-11-20 09:08:29

Yes, except that the contracts are checked at each call of the procedure. So if (define (foo x) (values x x)) is contracted with (-> any/c any/c) an exception will be raised on the first call to foo, but not during compilation.


kokou.afidegnon
2020-11-20 09:35:25

but in that case, foo must be supplied a single value argument, right ?



kellysmith12.21
2020-11-20 09:41:19

If you try to call foo with more than one argument, a contract exception will be raise.


laurent.orseau
2020-11-20 09:42:55

(when test body ...) is equivalent to (if test (begin body ...) (void)) So you should use when when you want to write an if like the above.


kokou.afidegnon
2020-11-20 09:44:30

i don’t get it


kellysmith12.21
2020-11-20 09:44:35

It’s mostly useful when you want to conditionally execute some imperative code.


kellysmith12.21
2020-11-20 09:45:46

(when test (set! x something))


kokou.afidegnon
2020-11-20 09:46:16

if understand, when is an if devoid of failure case?


laurent.orseau
2020-11-20 09:46:36

yes


kokou.afidegnon
2020-11-20 09:46:43

thanks,


soegaard2
2020-11-20 14:36:55

kokou.afidegnon
2020-11-20 14:47:02

thanks


badkins
2020-11-20 20:32:16

I just installed a package from the main catalog. If I now want to work with the latest source from github instead, what is required? After making a change to the source, do I just raco pkg update and pass a flag to use my directory vs. the main catalog?


badkins
2020-11-20 20:41:07

Hmm… simpler than I thought: raco pkg remove frog git clone <my fork> raco pkg install ~/my-dir


badkins
2020-11-20 21:05:51

samth
2020-11-21 02:22:25

raco pkg update —clone frog, and then go to frog and do the appropriate git commands


samth
2020-11-21 02:22:34

That’s what I’d do