racket Questions

2

I have a Racket list with some values (list 'foo 'bar 2 #t 42 9 2 'some). In reality these values follow some more specific pattern but for the question this is irrelevant. I want to test test if t...
Bering asked 7/4, 2016 at 20:35

1

Solved

Racket provides protect-out to prevent module exports from being used with eval (or a deconstructed syntax object), unless the module has enough privileges (aka, has a strong enough code inspector)...
Idiosyncrasy asked 8/8, 2018 at 17:28

1

I would like to create a new language that has the same syntax as typed racket, but when executed will do two things: run the given program as typed racket if type checks, then translates the inp...
Rozanneroze asked 5/8, 2018 at 6:21

4

Solved

While translating some Fortran to Scheme/Racket I have come across the function: ; EPSILON(X) The least positive number that added ; to 1 returns a number that is greater than 1 How do I find th...
Ordnance asked 9/7, 2012 at 18:13

15

Solved

I am looking for a version of Scheme or even LISP that I can use to recover some lost Lisp development skills. Some web capabilities would be nice but not essential. I've looked at Plt and ...
Kohler asked 19/1, 2009 at 21:52

1

Solved

Let's say I have a module "foo.rkt" which exports a struct foo, e.g., #lang racket (provide foo) (struct foo ()) In another module, I use "foo.rkt" but I'd also like to associate the binding to ...
Nutwood asked 17/6, 2018 at 14:53

3

Solved

I want to work through this book: http://www.eecs.berkeley.edu/~bh/ss-toc2.html. But I'm having trouble to get the "Simply Scheme" language working. The code won't run. #lang planet dyoo/simply-s...
Desiree asked 5/10, 2013 at 22:43

2

Solved

So as far as I understand, the following: let, let*, letrec and letrec* are synthetics sugars used in Scheme/Racket. Now, if I have a simple program: (let ((x 1) (y 2)) (+ x y)) It is transl...
Estradiol asked 31/5, 2018 at 15:26

2

Solved

I'm reading the scheme programming language, in chapter 3, the book use define-syntax to define or and and procedure, and it says the following definition of or is incorrect: (define-syntax or ; i...
Mesnalty asked 1/6, 2018 at 6:42

4

I want to write a function in Racket which takes an amount of money and a list of specific bill-values, and then returns a list with the amount of bills used of every type to make the given amount ...

1

Solved

Testing code: (define-syntax (test-d stx) #'(begin (define (callme a) (writeln a)))) (define-syntax (test-e stx) (datum->syntax stx '(begin (define (callme2 a) (writeln a))))) > ...
Exum asked 5/4, 2018 at 9:43

3

Solved

I would like to set the language in the REPL on the fly, with #lang, not using "-I" command-line argument. But this gives me the error "read: #lang not enabled in the current context". Is there a ...
Notepaper asked 8/1, 2014 at 23:16

2

How to check if an element is present in a list, both taken as input from the function call, without using the lambda? I was trying member? but could not get it. (define (find-string (lst lst str ...
Goffer asked 17/3, 2016 at 19:47

1

Solved

I'd like to easily create a list of digits from an input number using Scheme's number->string and string->list functions. This will code create the list of digits I want, but with one probl...
Sungkiang asked 19/3, 2018 at 1:43

2

Solved

If I want to optionally require a module at runtime, I can use [dynamic-require'1. This works great if I want to require a package that has been installed, for example: (dynamic-require 'racket/ma...
Teodora asked 6/3, 2017 at 18:21

3

Solved

I would like to include all the functions defined in a given racket file so that I get the same effect as if they were copied. Is it possible to do that?
Conny asked 26/1, 2011 at 20:5

4

I am trying to use the check-expect function in scheme but I keep being told its an unbound identifier for check-expect. Isn't check-expect a function I can use already? Below is my code: #lang ra...
Starkey asked 1/2, 2014 at 0:25

2

Solved

I am new to Lisp-scheme and fairly new to the functional paradigm as a whole, and am currently doing an assignment which requires me to overload a function with the same name, but different sets of...
Frumpy asked 4/2, 2018 at 23:31

1

Solved

The Racket docs indicate that Racket has separate forms for: require, load, include, and import. Many other languages only contain one of these and are generally used synonymously (although obvious...
Pertinacious asked 31/1, 2018 at 18:4

2

Solved

In Racket, there are two Generic Number procedures named add1 and sub1, equivalent to (curry + 1) and (curryr - 1) respectively. Are these procedures for stylistic use or do they have some sort of...
Defoliant asked 25/1, 2018 at 4:5

2

Solved

about the define-match-expansion, there are rare materials and example codes to illustrate the concepts. I am having a hard time to "decode" what the documentation says: (define-match-expander id...
Antiscorbutic asked 27/2, 2011 at 21:22

1

During the execution of my code I get the following errors in the different Scheme implementations: Racket: application: not a procedure; expected a procedure that can be applied to arguments g...
Hootchykootchy asked 2/1, 2018 at 17:0

2

Solved

I am aware of racket's log function, which computers the natural logarithm of a number. I am trying to find the logarithms of numbers raised to arbitrary bases. In other words, instead of this: &g...
Deepsix asked 7/2, 2013 at 1:15

1

Solved

As any secondary math student can attest, pi is irrational. And yet: Welcome to Racket v5.3.6. > pi 3.141592653589793 > (rational? pi) #t Is this because the representation of pi, in the ...
Almund asked 28/10, 2017 at 5:30

2

I have the following htdp/bsl program saved as example.rkt: #lang htdp/bsl (+ 1 1) When the above is run using racket example.rkt, the output is as expected (i.e. 2). However, when I try to sta...
Tafoya asked 4/9, 2017 at 23:28

© 2022 - 2024 — McMap. All rights reserved.