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)...
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...
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 ...
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...
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...
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 ...
Gangway asked 29/4, 2018 at 12:7
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)))))
> ...
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 ...
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 ...
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...
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...
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?
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...
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...
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...
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.