[racket-users] on the name of a data structure

2017-06-28 Thread Daniel Bastos
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

Re: [racket-users] Proper non-tail recursion?

2017-04-28 Thread Daniel Bastos
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

Re: [racket-users] Proper non-tail recursion?

2017-04-28 Thread Daniel Bastos
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

Re: [racket-users] Is this a closure?

2017-04-23 Thread Daniel Bastos
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

Re: [racket-users] beautiful-racket, contract-violation: expected: module-path? given ('planet ....)

2017-03-24 Thread Daniel Bastos
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

Re: [racket-users] beautiful-racket, contract-violation: expected: module-path? given ('planet ....)

2017-03-21 Thread Daniel Bastos
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

[racket-users] beautiful-racket, contract-violation: expected: module-path? given ('planet ....)

2017-03-21 Thread Daniel Bastos
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://

Re: [racket-users] racket-mode: OK to require Racket 6.0+?

2016-10-10 Thread Daniel Bastos
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

[racket-users] pkg collections: packages installed, although setup reported errors

2016-09-24 Thread Daniel Bastos
​%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

Re: [racket-users] Racket Shell

2016-08-24 Thread Daniel Bastos
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

[racket-users] Re: on updating the aws package to api version 20120810

2016-07-24 Thread Daniel Bastos
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

[racket-users] on updating the aws package to api version 20120810

2016-07-20 Thread Daniel Bastos
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

[racket-users] on the racket web server and the configure servlet

2016-07-05 Thread Daniel Bastos
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.

[racket-users] on solving linear systems by way of determinants

2016-01-18 Thread Daniel Bastos
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

[racket-users] on "module: identifier already imported from a different source"

2015-06-30 Thread Daniel Bastos
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

[racket-users] htdp/2e: exercises 336-338, feedback desired and questions

2015-04-02 Thread Daniel Bastos
​​ 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

Re: [racket-users] manifesto move

2015-03-30 Thread Daniel Bastos
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

[racket] htdp/2e: on types and popular scripting languages

2015-01-22 Thread Daniel Bastos
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

[racket] htdp/2e: exercise 302, difficulties

2015-01-21 Thread Daniel Bastos
;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

[racket] htdp/2e: exercise 197, a solution, feedback welcome

2015-01-21 Thread Daniel Bastos
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

[racket] htdp/2e: exercise 48, drracket highlighting

2015-01-19 Thread Daniel Bastos
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

[racket] htdp/2e: on the choice of some names

2015-01-15 Thread Daniel Bastos
(*) 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

[racket] htdp: exercise 21.1.3

2014-09-25 Thread Daniel Bastos
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

[racket] on reversing a list by way of sort

2014-09-15 Thread Daniel Bastos
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

Re: [racket] missing solution 20.1.2 ex:syn-funcs

2014-09-15 Thread Daniel Bastos
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

Re: [racket] missing solution 20.1.1 ex:sem-funcs

2014-09-15 Thread Daniel Bastos
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

Re: [racket] missing solution 20.1.1 ex:sem-funcs

2014-09-12 Thread Daniel Bastos
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

Re: [racket] missing solution 20.2.4 ex:fancy-contracts-poly

2014-09-12 Thread Daniel Bastos
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 >

Re: [racket] htdp: functions of section 19 violate the grammar of section 8

2014-09-11 Thread Daniel Bastos
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

Re: [racket] htdp: functions of section 19 violate the grammar of section 8

2014-09-10 Thread Daniel Bastos
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

[racket] htdp: functions of section 19 violate the grammar of section 8

2014-09-10 Thread Daniel Bastos
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

[racket] missing solution 20.2.4 ex:fancy-contracts-poly

2014-09-04 Thread Daniel Bastos
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

[racket] missing solution 20.2.3 ex:filter-contract

2014-09-03 Thread Daniel Bastos
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

[racket] missing solution 20.2.2 ex:fancy-contracts

2014-09-03 Thread Daniel Bastos
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

[racket] missing solution 20.2.1 ex:arrows-dd

2014-09-03 Thread Daniel Bastos
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

[racket] missing solution 20.1.2 ex:syn-funcs

2014-09-02 Thread Daniel Bastos
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

[racket] missing solution 20.1.1 ex:sem-funcs

2014-09-02 Thread Daniel Bastos
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

[racket] missing solution 19.2.4 ex:para-non-empty

2014-08-29 Thread Daniel Bastos
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

[racket] missing solution 19.1.6 ex:abs-sort

2014-08-29 Thread Daniel Bastos
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

[racket] missing solution 16.3.3 ex:file-du

2014-08-08 Thread Daniel Bastos
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

[racket] on emacs keybindings in dr racket (Was: Re: on contract violation after adding 1471 strings to a BST)

2014-08-08 Thread Daniel Bastos
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

Re: [racket] on contract violation after adding 1471 strings to a BST

2014-08-08 Thread Daniel Bastos
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

Re: [racket] on contract violation after adding 1471 strings to a BST

2014-08-05 Thread Daniel Bastos
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

Re: [racket] on contract violation after adding 1471 strings to a BST

2014-08-05 Thread Daniel Bastos
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

[racket] on contract violation after adding 1471 strings to a BST

2014-08-05 Thread Daniel Bastos
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

[racket] changing source code with application still running

2012-10-10 Thread Daniel Bastos
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

Re: [racket] db.plt, long query

2012-09-10 Thread Daniel Bastos
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,

[racket] db.plt, long query

2012-09-10 Thread 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? Racket Users list: http://lists.racket-lang.org/users

Re: [racket] racket's template system: expand: unbound identifier

2011-11-25 Thread Daniel Bastos
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

[racket] racket's template system: expand: unbound identifier

2011-11-24 Thread Daniel Bastos
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