To me a binary tree can be defined like this.
;; A BinaryTree is either
;; - false OR
;; - (BinaryTree Anything BinaryTree BinaryTree)
I built a data structure which looked like a tree, but I think it's
different. What should this be called? I called it a blob since I didn't
know what it wa
On Fri, Apr 28, 2017 at 12:29 PM, Matthias Felleisen
wrote:
>> On Apr 28, 2017, at 11:12 AM, Ben Greenman
>> wrote:
>>
>> On Fri, Apr 28, 2017 at 11:08 AM, Daniel Bastos wrote:
>> interview done with Guido van Rossum
>>
>> http://neopythonic.blogspot.c
On Fri, Apr 28, 2017 at 11:19 AM, Matthias Felleisen
wrote:
> [...] Their implementors will argue that deep recursions don’t exist or
> shouldn’t be supported. [...]
Python's argument for not supporting tail-call optimization (if I
should call it that way after this thread) is that it makes it f
There's another sense of the word ``closure'' while still in the subject
of computing but which is different from what you've understood so far.
Your understanding and the sense of the word used by Matthias Felleisen
and David Storrs is that of Peter Landin in 1964.
In ``[t]he mechanical evaluatio
On Tue, Mar 21, 2017 at 5:28 PM, Alexis King wrote:
> The unlib package is an old PLaneT package, so it won’t show up
> when you run `raco pkg show`. It’s a dependency of the snooze package
> (also from PLaneT), which you appear to have installed. Unfortunately,
> the unlib package appears to have
On Tue, Mar 21, 2017 at 1:16 PM, John Clements
wrote:
> It looks to me as though this error may have nothing to do with beautiful
> racket, and that beautiful racket may have installed successfully.
>
> In particular, it looks like an error occurred while building the docs for
> ‘unlib’, and tha
This was installed via DrRacket. The generated command line was:
raco.exe pkg update --deps search-auto --scope user beautiful-racket
See errors below. Thank you.
Resolving "beautiful-racket" via
https://download.racket-lang.org/releases/6.6/catalog/
Resolving "beautiful-racket" via https://
I use it. I really like it. Go ahead! (And thank you!)
On Mon, Oct 10, 2016 at 3:08 PM, Greg Hendershott
wrote:
> This is a heads-up that I want to update racket-mode for Emacs to
> require Racket 6.0 or newer.
[...]
--
You received this message because you are subscribed to the Google Grou
%raco pkg install collections
Resolving "collections" via
https://download.racket-lang.org/releases/6.6/catalog/
Resolving "collections" via https://pkgs.racket-lang.org
Downloading repository git://github.com/lexi-lambda/racket-collections
The following uninstalled packages are listed as dependen
On Sat, Aug 20, 2016 at 4:17 PM, William G Hatch wrote:
> I'm really interested in people's thoughts about both parts and ways people
> think they could be improved.
Hi, William. Have you looked at ESHELL to see if it has anything of interest?
%(format-time-string "%D %H:%M:%S" (seconds-to-time
ty like create-table-jsexpr
> (but not breaking backward compatibility -- e.g. let's not remove
> create-table or change the endpoint default.)
>
> In any case would you mind making a pull request at
> https://github.com/greghendershott/aws please? That would be easier
> (for me
Thank you for writing the aws package.
Currently, it supports the api version 20111205. I updated dynamo.rkt
to use the newer api 20120810. I updated the tests as well. I touched
only dynamo.rkt.
(*) What did I change
My needs began with create-table because the new api version changed
consid
I'm investigating the Racket Web Server. It seems to me the default
server-root-path is
Racket/share/pkgs/web-server-lib/web-server/default-web-root/htdocs
because I specified ``#:server-root-path "htdocs"'' and I saw the
program was missing conf/ files and it gave away this directory above.
Dear Rackteers, I appreciate getting feedback on this small victory. I
know so many come here asking for such things. So let me try to offer
you something too. How about fun with history? Did you know that you
could solve linear systems with mere determinant computation? I didn't!
After Gauss
I'm getting "module: identifier already imported from a different
source" when I require these two modules.
(require math/number-theory)
(require racket/list)
I want factorize from math/number-theory and remove-duplicates from racket/list.
I've seen old messages about this error, but they seemed
Exercise 336. Is (bundle "abc" 0) a proper use of the bundle function? What
does it produce? Why?
Solution. It's not a proper use. It produces nothing. It doesn't
terminate. Because (drop ls 0) returns a list not smaller than ls, hence
the recursion of bundle doesn't reach the base case.
I
Matthias, at least in this new address the PDF is a broken link. It
currently points to
http://www.ccs.neu.edu/home/matthias/manifesto/manifesto.pdf
which yields a "file not found" answer upon request.
On Sat, Mar 28, 2015 at 11:03 AM, Matthias Felleisen
wrote:
>
> Now that the scribble is m
Near exercise 305, HtDP/2e says that "[in] ISL+ (... and in the currently
popular scripting languages) such an informal signature with a definite
meaning is acceptable on occasion; do not use it too often, however."
It refers to this definition.
; [List-of Attribute] or [List-of Xexpr.v2] -> Bool
;Gentlemen, I'm having difficulties with X-expressions. I decided to make
up examples for each type that appears as a way to engage myself in the
business, but I fail to be sure whether my examples are correct.
; An Xexpr.v0 (short for X-expression) is
; (cons Symbol '())
(define sv0.0 (cons 'ma
I had a lot of difficulties with exercise 195, 196, 197. I'm posting my
solution to exercise 197 to get a chance to get feedback. How would have
you represented the FSM from exercise 100?
;Exercise 197. Consider the following data representation for finite state
machines:
(define-struct fsm (initi
Exercise 48. If you copy and paste the above function definition into the
definitions area of DrRacket and click RUN, DrRacket highlights two of the
three cond lines. This coloring tells you that your test cases do not cover
all possible cases. Add enough tests to make DrRacket happy. #
This exerc
(*) Curiosity
1. I wonder what BS stands for in this definition.
; A BS is one of:
; — "hello",
; — "world", or
; — pi.
Is it just a synonym for nonsense?
2. I figure "MT" means "empty" because of how it sounds. Is that it?
; an empty scene:
(define MT (empty-scene 100 100))
3. I figure "posn
The solution is missing, but I thought of exposing this one here so that it
gets scrutinized before sending it to Robby Findler.
;; Exercise 21.1.3. Define natural-f, which is the abstraction of the
;; following two functions:
;;
;; ;; copy : N X -> (listof X)
;; ;; to create a list that contain
Dear Racketeers, I was studying the exercise 20.2.4 of HtDP when I came up
with this way of reversing lists. (Every element is a least element. Or
greatest.)
(define (f x y)
true)
(define (rev ls)
(sort ls f))
Welcome to DrRacket, version 6.0.1 [3m].
Language: Intermediate Student; memory li
On Mon, Sep 8, 2014 at 9:51 PM,
Matthias Felleisen wrote:
On Sep 2, 2014, at 12:05 PM, Daniel Bastos wrote:
>
> > Exercise 20.1.2. Argue why the following sentences are legal
> > definitions:
> >
> > (define (f x) (x 10))
> >
> > (define (f x
On Fri, Sep 12, 2014 at 6:43 PM,
Matthias Felleisen wrote:
> On Sep 12, 2014, at 4:40 PM, Daniel Bastos wrote:
>
> > Again, we start with (2) and apply a series of substitutions.
> >
> > (f f)
> > = ( ) ;; since f is a
> > = ( ) ;; since is a subse
On Mon, Sep 8, 2014 at 9:51 PM,
Matthias Felleisen wrote:
On Sep 2, 2014, at 11:45 AM, Daniel Bastos wrote:
>
> > A candidate for a solution.
> >
> > Exercise 20.1.1. Assume the Definitions window in DrScheme contains
> > (define (f x) x). Identify the values amon
On Mon, Sep 8, 2014 at 9:51 PM,
Matthias Felleisen wrote:
On Sep 4, 2014, at 12:54 PM, Daniel Bastos wrote:
>
> > A candidate for a solution. (I'm not sure I'm correct regarding the
> > function project. The description says "a lists of lists" (which I
>
It makes sense, yes. I mean, the overall message. But I'm trying to
pinpoint where the grammar of section 8 tells me "no, you cannot put a
function name in an argument of an application". I read again the
entire section 8, am reading section 19 again and I still don't see
it. I'll write my argument
I remember having had that question when I was at that chapter. I must
have thought I answered it, but I'm having it again and unable to
answer now. IOW, I'm confused.
I'm having difficulties with this phrase too. "First, the names of
functions and primitive operations are used as arguments in
app
I have not been able to verify this statement.
"As a matter of fact, the functions of section 19 violate the Scheme
grammar of section 8." -- First paragraph of section 20.
I think the statement is referring to functions such as filter1.
(define (filter1 rel-op alon t)
(cond
[(empty? alo
A candidate for a solution. (I'm not sure I'm correct regarding the
function project. The description says "a lists of lists" (which I
translate to (listof ITEM)) and "a function from lists to Xs", so I
wonder if the domain of this function-argument must be (listof ITEM)
or it could be more general
A candidate for a solution.
;; Exercise 20.2.3. Use filter1 to develop a function that
;; consumes a list of symbols and extracts all those that
;; are not equal to 'car. Give filter1's corresponding contract.
;; Solution.
(define (filter1 rel-op alon t)
(cond
[(empty? alon) empty]
[el
A candidate for a solution.
Exercise 20.2.2. Formulate contracts for the following functions:
1. sort, which consumes a list of numbers and a function that consumes
two numbers (from the list) and produces a boolean; sort produces a
list of numbers.
2. map, which consumes a function from numbers
A candidate for a solution.
Exercise 20.2.1. Explain the following classes of functions:
1. (number -> boolean),
2. (boolean symbol -> boolean),
3. (number number number -> number),
4. (number -> (listof number)), and
5. ((listof number) -> boolean).
Solution.
(1) consumes a number
Exercise 20.1.2. Argue why the following sentences are legal
definitions:
(define (f x) (x 10))
(define (f x) f)
(define (f x y) (x 'a y 'b))
Solution. The relevant part of the grammar is the following.
= (define ( ...) )
| (define )
| (define-struct ( ...))
(*) First d
A candidate for a solution.
Exercise 20.1.1. Assume the Definitions window in DrScheme contains
(define (f x) x). Identify the values among the following expressions:
(1) (cons f empty)
(2) (f f)
(3) (cons f (cons 10 (cons (f 10) empty)))
Explain why they are values and why the remaining express
Perhaps I didn't understand this exercise. The hint advises me to work with
a particular case and then generalize. I did this, but it seems that even
in a particular case the most natural solution seems to be the general one.
The generalization took place only in the data definition, but it didn't
A candidate for a solution.
;; sort1 : list-of-numbers -> list-of-numbers
;; to construct a list with all items from alon in descending order
(define (sort1 cmp alon)
(local ((define (sort alon)
(cond
[(empty? alon) empty]
[else (insert (first alon) (sor
A candidate for a solution.
;; model 3
(define-struct file (name size content))
(define-struct dir (name dirs files))
;; files:
(define hang (make-file 'hang 8 empty))
(define draw (make-file 'draw 2 empty))
(define read (make-file 'read! 19 empty))
(define one (make-file 'part1 99 empty))
(defi
On Fri, Aug 8, 2014 at 9:34 AM, Matthias Felleisen
wrote:
> Why not turn on Emacs bindings inside of DrRacket?
I'll take the advice.
BTW, some of my preferences windows don't show nicely because I use large
fonts on my system. (See image attached.) Also, I think I only found the
option being w
On Tue, Aug 5, 2014 at 5:43 PM, Matthias Felleisen
wrote:
> Warning: you switched from a teaching language to full Racket.
> The former would have caught this mistake, which is why we
> designed them for HtDP. Racket is for grown-up parenthesis
> eaters -- who want the behavior of cond that you j
Thanks for pointing this out.
On Tue, Aug 5, 2014 at 5:43 PM, Matthias Felleisen
wrote:
> Warning: you switched from a teaching language to full Racket.
> The former would have caught this mistake, which is why we
> designed them for HtDP. Racket is for grown-up parenthesis
> eaters -- who want
On Tue, Aug 5, 2014 at 5:06 PM, Jens Axel Søgaard
wrote:
> What happens in create-bst-word, when the word to inserted is the same
> as (node-word bst) ?
Aha! I see. It returns void because there is no case for when the string is
equal.
> (void? (create-bst-word (create-bst-word false "dan") "d
After studying chapter 14 of HtDP, I decided to try putting strings into a
BST. The code below works with a few strings. I have a file with 22064
strings --- one per line. Up until 1471 words, it works. With 1472 it
yields a contract violation.
> (length (read-words))
22064
> (create-bst-word-fro
Here's a quote from Paul Graham --- quoting from
http://bc.tech.coop/blog/040223.html.
"When one of the customer support people came to me with a report of a
bug in the editor, I would load the code into the Lisp interpreter and
log into the users' account. If I was able to reproduce the bug I'd
g
2012/9/10 Daniel Bastos :
> It seems that if I give a very long string to query-rows, I get the
> following message.
>
> query-rows: unsupported type: (typeid string)
>
> Short queries are no problem. How do you guys do this properly?
The problem is not the length of the query,
It seems that if I give a very long string to query-rows, I get the
following message.
query-rows: unsupported type: (typeid string)
Short queries are no problem. How do you guys do this properly?
Racket Users list:
http://lists.racket-lang.org/users
2011/11/25 Jay McCarthy :
> The lack of a space between ] and { is important. Notice that the example in
> the documentation is
> @in[c clients]{
> @(car c), @(cdr c)
> }
> not
> @in[c clients] {
> @(car c), @(cdr c)
> }
Indeed. Thanks. I wonder why there is such requirement. Does it avo
Good evening, gentlemen.
I'm studying
http://docs.racket-lang.org/web-server/templates.html
to see how web development is done in Racket. Having written a first
hello world using templates, I'm wishing to use the @in[] call. So I
wrote
%cat templates1.rkt
#lang racket
(require web-server/serv
50 matches
Mail list logo