
@schpaencoder has joined the channel

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

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

Yes, I see what you mean

Does not work though

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

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

right, symbols are not functions

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

mostly my suggestion would be to not try to do that

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

I thought that was what I wanted

ah, you mean without the first arg

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

thanks

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)))

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”)

Thank you!

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

can you say more about how you installed it?

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

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

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 the
func-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 (?????????)] `

@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 ...)
.

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

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