schpaencoder
2018-8-30 13:24:44

@schpaencoder has joined the channel


schpaencoder
2018-8-30 13:26:58

How can I do this in racket: (map (lambda (f a) (apply f a '(solid blue))) '((triangle 20) (circle 20)))


samth
2018-8-30 13:38:07

try `((,triangle 20) (,circle 20))


schpaencoder
2018-8-30 13:44:42

Yes, I see what you mean


schpaencoder
2018-8-30 13:45:02

Does not work though


schpaencoder
2018-8-30 13:45:32

I guess what I want to do is just have a list of function-identifiers and apply them to something in a map


schpaencoder
2018-8-30 13:46:02

I end up with ’circle (for instance), but cannot use this a function


samth
2018-8-30 13:46:15

right, symbols are not functions


schpaencoder
2018-8-30 13:46:29

so how can I convert a symbol into a function-name


samth
2018-8-30 13:46:33

mostly my suggestion would be to not try to do that


samth
2018-8-30 13:46:50

is there a reason you can’t just have a list of functions?


schpaencoder
2018-8-30 13:47:02

I thought that was what I wanted


schpaencoder
2018-8-30 13:47:26

ah, you mean without the first arg


samth
2018-8-30 13:47:51

this program works: #lang racket (require 2htdp/image) (map (lambda (l) (apply (first l) (second l) '(solid blue))) `((,triangle 20) (,circle 20)))


schpaencoder
2018-8-30 13:48:11

thanks


gfb
2018-8-30 14:24:26

You might enjoy this use of apply, that generalizes to more initial arguments: #lang racket (require 2htdp/image) (map (lambda (f-args) (apply apply (append f-args '((solid blue))))) `((,triangle 20) (,circle 20)))


jlshown
2018-8-30 14:27:08

Hello Everyone, it is good to be on the Racket Slack channel. I have a quick question. I have the following error message, if you know how I can resolve it, I would appreciate the teaching moment! Error in phase 2 for tool #<path:C:\Users\jlshown\AppData\Roaming\Racket\planet\300\7.0\cache\dyoo\simply-scheme.plt\2\2\tool.rkt>; #f

drracket:language-configuration:add-language: found two languages with the same result from get-language-numbers: (–500 0), (“Teaching Languages” “Simply Scheme”) and (“Teaching Languages” “Simply Scheme”)


jlshown
2018-8-30 14:27:11

Thank you!


samth
2018-8-30 14:28:37

@jlshown it looks like you installed “Simply Scheme” twice


samth
2018-8-30 14:28:45

can you say more about how you installed it?


jlshown
2018-8-30 16:13:12

Hello Samth, yes that’s exactly what happened. I used the package manager, I didn’t realize that occurred.


samth
2018-8-30 18:29:05

@jlshown I think the best thing to try is to remove the version that you install with planet


plotnus
2018-8-30 21:56:13

Hello Team Racket, another question for you.

In the example func-param' came from a define-syntax-class. I want to get the datum from the syntax class but also forward the syntax for the class. Is there a way to create a list of the syntax for thefunc-parampassed in in the following example? (syntax-parse stx [(_ fid:maybe-fid (~describe “description” (p:func-param …)) rt:maybe-return-type e:expr …) (quasisyntax/loc stx (let* ([params (list p.norm …)] [param-stx-list (?????????)] `


gfb
2018-8-30 22:38:35

@plotnus Does replacing (???????????) with (quote-syntax (p ...)) do what you want? Note that parsing and reconstructing with ... will lose the syntax information of the surrounding parentheses. If you want to keep that as well, replace (p:func-param ...) with (~and ps (p:func-param ...)) and then you can use ps instead of (p ...).


plotnus
2018-8-30 23:55:39

@gfb (quote-syntax (p ...)) was a step in the right direction. Thank you! the final solutino was (syntax-&gt;list (quote-syntax (p ...)))


leif
2018-8-31 00:01:16

@jbclements How do you cause portaudio and rsound streams to stop when you close the tab in DrRacket?