racket Questions

2

Solved

I'm trying to define a new language in racket, let's call it wibble. Wibble will allow modules to be loaded so it has to translate it's forms to Racket require forms. But I'm having trouble getting...
Aback asked 25/7, 2015 at 8:9

2

Solved

On Exercise (or entry?) 57, I'm just not understanding how the logic flows. The question is that this: given (define teacupo (lambda (x) (conde ((= tea x ) #s) ((= cup x ) #s) (else #u)))) ...
Onyx asked 4/7, 2015 at 19:48

2

I understand how to write a function that takes an arbitrary number of arguments using the dot notation. Example: (define (func-name . args) func-body). And I understand how to use a constructor g...
Cloak asked 3/7, 2015 at 18:2

1

Solved

I'm porting a Python script to Racket as a learning experience, and I have this function: (define (check-status) (define git [find-executable-path "git"]) (define-values (ckot out in err) (subp...
Convertiplane asked 3/6, 2015 at 16:37

1

Solved

I've been going through Contracts in the Racket Guide. The ->i construct allows one to place arbitrary constraints on the input/output of a function. For example, I could have an unzip functio...
Yellowweed asked 26/5, 2015 at 17:28

1

Solved

I've just set up Racket and have been trying out the interpreter. However, I can't seem to go up and down the command history using the arrows (or Ctrlp/Ctrln for that matter) or use Ctrlr to sear...
Kelleekelleher asked 26/5, 2015 at 10:0

3

Are there any built in functions in racket to compare 2 dates? If not can anyone tell me how to write a function to compare 2 dates in racket. I am very new to functional programming languages ple...
Spectrograph asked 20/5, 2015 at 15:58

3

Solved

I am just wondering if there is the string split function? Something like: > (string-split "19 2.14 + 4.5 2 4.3 / - *") '("19" "2.14" "+" "4.5" "2" "4.3" "/" "-" "*") I haven't found it and c...
Reggie asked 7/10, 2011 at 19:6

3

Solved

What's the simplest way to define a capturing macro using define-syntax or define-syntax-rule in Racket? As a concrete example, here's the trivial aif in a CL-style macro system. (defmacro aif (...
Cataldo asked 18/11, 2013 at 17:44

1

Solved

Consider the following example: #lang racket (match '(cat . doge) [`(,a . ,b) (match b [a #t] [_ #f])] [_ "Not a pair"]) This is what I might write if I wanted to match pairs where the hea...
Taeniacide asked 30/4, 2015 at 21:59

1

Solved

I'm trying to decipher the documentation call-with-continuation-prompt Applies proc to the given args with the current continuation extended by a prompt. The prompt is tagged by prompt-tag, w...
Vallation asked 24/4, 2015 at 3:43

3

How can I define integers through stream-map in Scheme: (define integers (stream-cons 1 (stream-map *something* *something*))
Tapis asked 24/1, 2013 at 15:24

2

Solved

For example, there is a on-char method on the editor-canvas% class in racket/gui/base. It handles the 'wheel-up and 'wheel-down events and passes other events to the on-char method on canvas%. I w...
Sennar asked 13/4, 2015 at 14:51

4

Solved

What is the difference between values and list or cons in Racket or Scheme? When is it better to use one over the other? For example, what would be the disadvantage if quotient/remainder returns (c...
Laurinda asked 9/4, 2015 at 5:3

1

Solved

Racket's documentation only partially describe what augment and pubment do: augment makes a method that executes after the superclass's version of that method, while pubment makes a method that wil...
Severe asked 31/3, 2015 at 22:34

6

Solved

Racket is a descendant of Scheme. How is Racket different than R6RS? What did it add, or take away, or is just different? I understand that Racket is more than a language, it's a platform for lang...
Broadloom asked 27/7, 2010 at 15:46

2

Looking at > in Racket, the following makes sense: > (> 5 0) #t Why does the following evaluate to false? > (> 5 0 0) #f
Freighter asked 30/3, 2015 at 15:17

3

Solved

I augmented the memory of Dr. Racket a week ago, now I want to reduce it to the same amount as before. So I limit it back to 128 MB. But that has no effect... It is always consuming much more then ...
Unseemly asked 21/3, 2015 at 11:42

3

Solved

My company is designing a new domain specific scripting language; I have to implement a parser that translates our brand new programming language into a common scripting language so as to be able t...
Intubate asked 17/1, 2014 at 12:19

0

I can write a simple function in untyped Racket called curry-all that takes a list of functions, all of which accept the same kind of value for their first argument, and produces a list of function...

1

Solved

My brother wanted to introduce me to lisp languages, so he showed me DrRacket on his computer. Everything looked awesome, including arrows that point to where a function is being imported from, and...
Prescriptible asked 16/2, 2015 at 4:3

1

Solved

I'm new to Racket (and Lisp's in general) and I'm wondering if there's a canonical way to detect if a script was run from the command line? For example, in Python the standard way to do this would...
Rima asked 18/2, 2015 at 18:52

2

Solved

I have 2 dynamic lists that I would like to merge into one. Say '(1 2 3 4) and '(15 16) and get '(1 2 3 4 15 16) How can this be done?
Blunge asked 10/2, 2015 at 19:43

3

Solved

I don't like DrRacket because it does not have convenient edit capabilities as Emacs, however I can only run Scheme file through adding command "racket current-file.scm" in .emacs, now, I want to r...
Derr asked 1/10, 2012 at 13:29

2

Solved

I'm experimenting with Racket's GUI Toolkit and am trying to get a cool color-changing effect going on with ASCII art on the screen. I have a callback which does the color-changing, but I can't see...
Lorianne asked 20/8, 2012 at 21:59

© 2022 - 2024 — McMap. All rights reserved.