dcmicoltacespedes
2020-6-21 12:38:22

@badkins @wanpeebaw Thank you very much, the information helped me a lot, I was able to make the code :smiley:. Now I have another question by chance, do you have examples or do you know where I can see examples of how I can repeat a function? like a loop For example, a function that removes the largest number from three lists, but the action repeats up to 0 or is empty. thanks.


badkins
2020-6-21 13:23:16

@dcmicoltacespedes here’s an example of repeating the drop function on three lists concurrently: (define (drop-3 l1 l2 l3) (if (or (null? l1) (null? l2) (null? l3)) (values l1 l2 l3) (drop-3 (drop l1 1) (drop l2 1) (drop l3 1)))) (drop-3 '(1 2 3) '(4 5) '(6 7 8 9))


badkins
2020-6-21 13:27:06

So, you can simply replace drop with a function that does what you want e.g. removing the largest number.


dcmicoltacespedes
2020-6-21 14:55:24

Thank you. I have a question, values, is it to save the results of each list? or what do values ​​do?


badkins
2020-6-21 18:06:03

The drop-3 function needs to return 3 lists. One way to do that is with (values l1 l2 l3) , another way to do that is to put the 3 lists in another list (list l1 l2 l3). values will return multiple values, where list will return one value which is a list of lists.


badkins
2020-6-21 18:06:55

Using values might be a little more efficient since it won’t allocate a new list object, but either one is fine.


badkins
2020-6-21 18:58:33

Here’s an example of making use of the values: (let-values ([ (l1 l2 l3) (drop-3 '(1 2 3) '(4 5) '(6 7 8 9)) ]) (println l1) (println l2) (println l3))


advait.raykar
2020-6-21 19:10:57

I am having trouble creating a standalone runnable from my racket code. On trying raco exe or even raco distribute, I got a file. But on trying to execute it, this is what I keep getting collection-file-path: collection not found collection: "portaudio/lib" in collection directories: context...: /Applications/Racket v7.7/collects/racket/private/collect.rkt:26:58: fail '#%embedded:portaudio/portaudio:: [running body] temp35_0 for-loop run-module-instance! for-loop [repeats 1 more time] run-module-instance! for-loop [repeats 1 more time] run-module-instance! for-loop [repeats 1 more time] run-module-instance! for-loop [repeats 1 more time] ... Can’t find anything on the internet as to why this is happening. Any help?


advait.raykar
2020-6-21 19:12:40

the code runs perfectly fine when I run it using racket <filename>.rkt


badkins
2020-6-21 19:44:45

What operating system?


advait.raykar
2020-6-21 19:45:02

Mac OSX, Catalina.


advait.raykar
2020-6-21 19:45:57

badkins
2020-6-21 19:47:51

I’m running MacOS Catalina. I never create executables, but I just tried a hello world to make sure there wasn’t a file permission problem with Catalina (since they locked things down so much). My hello world worked fine using Racket 7.5 BC, so the general mechanism seems ok. In your case, there appears to be a problem finding a package, so you may need to supply an option.


badkins
2020-6-21 19:49:52

I expect others can provide better help, but maybe try --embed-dlls to see if it helps?


badkins
2020-6-21 19:50:25

oops - never mind, that appears to be Windows specific


advait.raykar
2020-6-21 19:52:24

I am not able to understand what this error message means, I am guessing rsound depends on port audio, and something is wrong with that, but then again, no idea how to fix it. I figured raco would take care of all dependencies


badkins
2020-6-21 19:56:03

This seems at least somewhat related: https://groups.google.com/forum/#!topic/racket-users/srVby-5HbT8 if so, it may be a problem with rsound.


samth
2020-6-21 19:58:08

My guess is that rsound or portaudio is doing something that doesn’t play well with raco exe.


samth
2020-6-21 19:58:21

Perhaps @jbclements could help more


jbclements
2020-6-21 20:06:30

@jbclements has joined the channel


advait.raykar
2020-6-21 20:27:18

Hmm, having a tough time making the project easy to install. Trying to make a home-brew formula for it, but that’s also tough, since I have never done that before either.