racket
How to write a macro that receives any number of arguments and print them out?
(define-syntax prnt (syntax-rules () [(prnt elem ...) (display (format \"~a\" elem .开发者_JAVA百科..))][详细]
2023-04-02 07:51 分类:问答Racket-related question
(define (mult a b);;function mult(a,b) (cond ((IsItZero? b) 0);;if b = 0: return 0 ((let((c (mult a (rest b))));;c = mult(a, floor(b/2))[详细]
2023-04-01 03:35 分类:问答Differences between #lang scheme and #lang racket
I\'m guessing that #lang racket is a dialect of scheme with much more out of the box structures and common functions and perhaps would be more pedagogic. What are the perks a #lang racket against #lan[详细]
2023-03-30 11:57 分类:问答Setting default argument value in Racket
Is it possible to set a def开发者_高级运维ault value to some of arguments in Racket? Like so in Python:[详细]
2023-03-29 18:19 分类:问答How can I use a string to reference a symbol?
The following code wi开发者_开发问答ll generate #f and #t 1: (define dict (hash 1 \'a 2 \'b )) 2: (hash? (string->symbol \"dict\"))[详细]
2023-03-28 12:47 分类:问答How to make it as procedure?
I have the scenario where a function returns an lambda form, and I want to apply the lambda form but failed. Example:[详细]
2023-03-28 09:26 分类:问答How do I pass a list as a list of arguments in racket?
I have a statement like this: ((lambda (a b c) (+ a b c)) 1 2 3) ; Gives 6 And I would like to be able to also pass it a list as so:[详细]
2023-03-27 10:15 分类:问答Why list-ref can not got the correct parameter?
I wrote a quick-sort in scheme (racket) #lang racket (define (quick-sort xs) (let* ([p (list-ref xs 0)] [tail (list-tail xs 1)][详细]
2023-03-23 13:32 分类:问答Racket: Using a macro across modules
In order to teach myself more advanced macros in racket, I set about creating a macro to increment a field in a mutable struct:[详细]
2023-03-22 22:34 分类:问答difference between free-identifier=? and bound-identifier=?
Trying to understand free-identifier=? and bound-identifier=?. Can anyone give me equivalent code examples wher开发者_C百科e using free-identifier=? would return true and using bound-identifier=? woul[详细]
2023-03-22 16:15 分类:问答