Re: [racket] Signature for an optional-argument function?

2013-08-23 Thread Matthias Felleisen
t;a" ...)) and be done. > You could also design a weird function that does completely different things > depending on what the arguments are, like this: For fun, you can write any kind of function you like. As long as you design these functions to match the structure of the dat

Re: [racket] Rackunit best practices

2013-08-23 Thread Matthias Felleisen
test the whole code base). So if you're thinking of package contributors, keep this in mind -- Matthias On Aug 23, 2013, at 2:09 AM, Chad Albers wrote: > Thanks everyone for their feedback. Keep it coming! I didn't know > about the ability to include tests next to the

Re: [racket] Signature for an optional-argument function?

2013-08-23 Thread Matthias Felleisen
a bit out of sync on occasion. The next step is Realm of Racket. And it's well within your reach, including a teaser chapter. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] fuzzy set representation in Racket

2013-08-23 Thread Matthias Felleisen
Here is one more alternative: #lang racket ;; you can move the body of this module into a '#lang racket' file called fuzzy-set-library.rkt (module fuzzy-set-library racket ;; rename-out is an elegant version of the let()/define-values trick in Realm of Racket (provide (rename-out (fuzz

Re: [racket] Why not use a typed language for HtDP?

2013-08-24 Thread Matthias Felleisen
rst.) Because: We picked the full language that we thought offers a decent goal (Racket) and developed teaching languages that gradually approximate the language but provide good feedback. -- Matthias On Aug 24, 2013, at 4:38 AM, Ben Duan wrote: > Dear All, > > Here’s a beginner

Re: [racket] Where to start programming for a 10 year old?

2013-08-24 Thread Matthias Felleisen
I don't see how either Scratch or Bootstrap can deliver the promised iOS app. But why don't you try Scratch first and report back to us, then try bootstrap-world.org -- Matthias On Aug 24, 2013, at 1:07 PM, Grant Rettke wrote: > Hi, > > My nephew seems pretty intere

Re: [racket] Where to start programming for a 10 year old?

2013-08-24 Thread Matthias Felleisen
With Bootstrap your nephew can at least share his games with friends and family on the web right away. Not a native app. On Aug 24, 2013, at 7:26 PM, Grant Rettke wrote: > On Sun, Aug 25, 2013 at 3:51 AM, Matthias Felleisen > wrote: >> I don't see how either Scratch

Re: [racket] running test-suites in module+ tests

2013-08-24 Thread Matthias Felleisen
Does this help: > #lang racket > > (module+ test > (require rackunit)) > > ;; --- > > (module+ test > (define-test-suite for-f > (check-equal? (f 10) 10) > (check-equal? (f 11) 12))) > > (define (f x) > x) > > > (module+ test > (require rackunit/text-ui) > (run-tests fo

Re: [racket] Handin server checker scripts

2013-08-26 Thread Matthias Felleisen
Have you considered mining the style guide for such rules? -- Matthias On Aug 26, 2013, at 2:03 PM, Jordan Johnson wrote: > Hi all, > > This fall I'm planning to be doing some further work towards a framework for > writing briefer checker scripts for Eli's ha

Re: [racket] fuzzy set representation in Racket

2013-08-26 Thread Matthias Felleisen
#x27;c .2) > (fuzzy-element 'd .3))) > > in the way you defined fuzzy-set above, how do you create the function > fuzzy-set? and how do you create fuzzy-first and fuzzy-rest ? > > Thanks, > Rian > > On Aug 23, 2013, at 8:02 PM, Matthias Felleisen wrote: >

Re: [racket] Functional Updates for Structs

2013-08-27 Thread Matthias Felleisen
ore static approach to structs than other scripting languages, from which you get a bit more safety and a bit more hassle. -- Matthias On Aug 27, 2013, at 12:37 AM, Danny Gratzer wrote: > Hello, > > I'm writing some code to manipulate a few structs and in doing so have

Re: [racket] Functional Updates for Structs

2013-08-27 Thread Matthias Felleisen
ed to know the struct type. I bet that this will work more easily than structs plus other macrology. -- Matthias On Aug 27, 2013, at 11:33 AM, Danny Gratzer wrote: > It's part of a DSL I'm writing, the idea being a user gives an accessor to > some struct, a function to t

Re: [racket] Racket on Mac OS w/o Authentication

2013-08-27 Thread Matthias Felleisen
You should not have to install as admin. Are you on 10.8 by any chance? On Aug 27, 2013, at 4:30 PM, Tristian Paul L—pez Azuara wrote: > Hello, > > Nice to meet every one, I'm trying to use the racket language on a 32-bit > Mac OS, the problem is that in order > to install it, I need to

Re: [racket] Help with exception raising and testing

2013-08-27 Thread Matthias Felleisen
with the richest system of syntax extensions. -- Matthias On Aug 27, 2013, at 7:48 PM, George Rudolph wrote: > I understand the idea of refactoring code to make it testable. > I very much appreciate the clarification on usage. Thank you. > But... > As I see it, th

Re: [racket] Worried about the new package manager not storing each version of a package

2013-08-28 Thread Matthias Felleisen
of users -- commercial, open source, extreme hobby, and the full range of educational efforts -- and we are hoping that people speak up when things go wrong. >From the very beginning of this project in 1994, we made feedback from users >our highest priority and we will continue to do so. -

[racket] applicative order -- topic was: Re: Help with exception raising and testing

2013-08-28 Thread Matthias Felleisen
by Plotkin's 1973 paper on "call-by-name, call-by-value, and the lc" in TCS. There are stone-aged authors who can't resist using this terminology but we should be enlightened enough to know that this is a bogus term w/o well-defined meaning :-) -- Matthias (heart-felt as you

Re: [racket] applicative order -- topic was: Re: Help with exception raising and testing

2013-08-28 Thread Matthias Felleisen
On Aug 28, 2013, at 12:33 PM, Grant Rettke wrote: > On Wed, Aug 28, 2013 at 11:04 PM, Matthias Felleisen > wrote: >> For the record, there is no such thing as 'applicative order.' There is >> call-by-value and there is a humongous misunderstanding >> ca

Re: [racket] applicative order -- topic was: Re: Help with exception raising and testing

2013-08-28 Thread Matthias Felleisen
On Aug 28, 2013, at 12:41 PM, Alexander McLin wrote: > In fact I learned that in SCIP, so I need to check when the edition I have > was published to see how old it really is. See other email. Bottom line is that Gerry and Hal are not PL researchers -- never have been -- and I doubt that they

Re: [racket] applicative order -- topic was: Re: Help with exception raising and testing

2013-08-28 Thread Matthias Felleisen
No problem. While we are on names. We use -- "Matt" for Matthew Might, a Utah researcher who also uses Racket; -- "Matthew" for Matthew Flatt, the CEO of PLT Design, Inc, creator of Racket, and ruler of the kingdom -- "Matthias" for me, which yes, is a for

Re: [racket] Rackunit best practices

2013-08-30 Thread Matthias Felleisen
We don't test contracts. In general contracts are relatively simple functions, but yes, we have written several papers on bugs in contracts and how this complicates a contract monitoring system. If you are asking how to test functions that have contracts, I import that module itself into a su

Re: [racket] Contract for methods with optional arguments

2013-08-31 Thread Matthias Felleisen
hen it is given 2 it returns the right one. (I am too uninformed to say whether you can literally return distinct types instead of distinct variants but I believe this to be the case.) In Typed Racket, you return a union type and you can then use subtyping to get the corr

Re: [racket] Confusing blame message

2013-09-02 Thread Matthias Felleisen
s error message [format] and that you aren't the last one. But changing it isn't easy and adding information isn't easy. The problem is that we wish to keep the messages uniform across all functions but not all functions can benefit from the actual contract system. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Confusing blame message

2013-09-02 Thread Matthias Felleisen
You're right on. Let's see what we can do -- Matthias On Sep 2, 2013, at 4:57 PM, Daniel Prager wrote: > Hi Matthias > > Thanks for the explanation - it helps. I played with the kind of > post-condition "broken contract" example that you gave, and find i

Re: [racket] Introductory talk on Contracts and Functional Contracts, with most examples in Racket

2013-09-03 Thread Matthias Felleisen
e careless. See binary-search but impose sorted? as a predicate on the vector that flows into the function. Good luck -- Matthias On Sep 3, 2013, at 2:37 AM, Daniel Prager wrote: > I'm giving this talk > > > http://www.slideshare.net/DanielPrager/introduction-to-c

Re: [racket] Introductory talk on Contracts and Functional Contracts, with most examples in Racket

2013-09-03 Thread Matthias Felleisen
On Sep 3, 2013, at 5:51 PM, Daniel Prager wrote: > Hi Matthias > > Thank-you for your sage advice: > > On Tue, Sep 3, 2013 at 11:54 PM, Matthias Felleisen > wrote: > > 1. Always use contracts that cannot be expressed as types > in an obvious type system. >

Re: [racket] Immutable vectors

2013-09-08 Thread Matthias Felleisen
On Sep 7, 2013, at 9:43 AM, Konrad Hinsen wrote: > That sounds reasonable, but in the scenario we are discussing > (accessing data structures implemented in Typed Racket from > plain Racket), the data structure never passes in that direction, > except if it's constructed from a plain Racket data

Re: [racket] Understanding GC when working with streams

2013-09-09 Thread Matthias Felleisen
I wonder whether you really want lazy streams. -- Matthias On Sep 9, 2013, at 10:19 AM, Lawrence Woodman wrote: > On 09/09/13 07:19, Stephen Chang wrote: >> Konrad's exactly right. Your filtered-nums blows up because you named >> the stream and then traversed the entire t

Re: [racket] Lifting submodules

2013-09-13 Thread Matthias Felleisen
Lift the module definition to top and require in the expression position? On Sep 13, 2013, at 12:08 PM, Eric Dobson wrote: > I want to write a macro which generates submodules and then possibly > requires them. This is so that can easily use another language (TR) > for the expression. > > If

Re: [racket] Modified esc;w

2013-09-14 Thread Matthias Felleisen
figure this out. Right now I urge you to point your students to this mailing list so that they can get help directly. As you probably know, people here are eager to help and it doesn't take a core developer to respond (as Robby already pointed out). -- Matthias On Sep 14, 2013, at 10:

Re: [racket] RacketCon full schedule

2013-09-18 Thread Matthias Felleisen
Why is RacketCon not advertised on racket-lang.org? On Sep 18, 2013, at 4:43 PM, Asumu Takikawa wrote: > On 2013-09-19 06:30:24 +1000, Daniel Prager wrote: >> Will the prsentations, or at least the keynotes, be recorded and made >> available? > > Yes, we will be recording the talks. We also

Re: [racket] Using GUI editor

2013-09-20 Thread Matthias Felleisen
On Sep 20, 2013, at 1:05 PM, Alan Johnsey wrote: > It looks like I’ve stumbled into another area where I’m lacking a basic > understanding of what’s going on. I’m trying to use the built-in editor in > the gui package, but I need to put some initial content into the editor > window. When I pu

Re: [racket] Using GUI editor

2013-09-21 Thread Matthias Felleisen
d on what is in the text% object. > > Robby > > > On Fri, Sep 20, 2013 at 8:40 PM, Alan Johnsey wrote: > Thanks. That will do for now, but it remains a mystery to me why my approach > doesn’t work. > > -Alan > > > > > > From: Matthias Fell

Re: [racket] Template variables

2013-09-21 Thread Matthias Felleisen
#lang racket (require (except-in 2htdp/image image?)) (require lang/htdp-advanced) ;; <-- this appears to override except-in, so stick to this order (require 2htdp/universe) On Sep 21, 2013, at 5:50 AM, Manfred Lotz wrote: > Hi there, > How could I use template variables (... aso.) when usi

Re: [racket] Null value in macros

2013-09-23 Thread Matthias Felleisen
Is the following code really that much more complicated that define-macro? -- Matthias #lang racket (require (for-syntax syntax/parse)) (define-syntax (new-field stx) (syntax-parse stx [(_ f:id) #'(new-field f null)] [(_ f:id default-value) (define field-name (append-i

Re: [racket] Null value in macros

2013-09-23 Thread Matthias Felleisen
I wanted to show how to define auxiliary functions for syntax processing, something you do wish to know when you come from Emacs/CL On Sep 23, 2013, at 12:31 PM, Sam Tobin-Hochstadt wrote: > On Mon, Sep 23, 2013 at 11:59 AM, Matthias Felleisen > wrote: >> >> (define

Re: [racket] RacketCon / hackathon question

2013-09-23 Thread Matthias Felleisen
What if we suggest some games to implement? He'd be alone but surrounded by Racketeers who know. On Sep 23, 2013, at 8:15 PM, Geoffrey S. Knauth wrote: > I'm bringing my 16 year-old son to RacketCon on Sunday, since he loves > Racket. It's also the weekend of my college 30th reunion. On th

Re: [racket] Introduction to syntax-parse

2013-09-26 Thread Matthias Felleisen
On Sep 25, 2013, at 7:59 AM, Sam Tobin-Hochstadt wrote: > I think the error message could be better Yes. Please. Racket Users list: http://lists.racket-lang.org/users

Re: [racket] How about a python ffi for Racket?

2013-10-04 Thread Matthias Felleisen
what I can tell though it may not eliminate the actual performance bottleneck. That's about all I can say -- Matthias On Oct 4, 2013, at 2:49 AM, Andrews, Kyle (KC) wrote: > Near the end of Matthew Bassett’s talk at RacketCon someone mentioned that > the Racket developers had int

Re: [racket] combine-in doesnt combine?

2013-10-09 Thread Matthias Felleisen
No images in 2htdp and htdp differ and there's some funny exporting/importing going on to get the predicates into the right place because they also work on copied/pasted images. On Oct 8, 2013, at 7:51 PM, Stephen Chang wrote: > Ok, I didn't realize they were different functions. I thought

[racket] updating Joe's and Greg's tutorial -- Re: Best way to propose changes to Scribble CSS files

2013-10-12 Thread Matthias Felleisen
It would be wonderful if someone could update either Joe's or Greg's tutorials on contributing at this level for the brave new world of packages. Or at least put it on the list for the next hackathon and perhaps include it in the docs. -- Matthias Ra

Re: [racket] error while loading simply.scm

2013-10-16 Thread Matthias Felleisen
0. Racket is not Scheme and this an example where the difference shows up. 1. Use the legacy language Pretty Big: Welcome to DrRacket, version 5.90.0.9--2013-10-15(efaa5bd1/d) [3m]. Language: Pretty Big. > (load "functions.scm") > 2. Even then, some functions are simply not defined in "Schem

Re: [racket] Need help using EOPL2e code in Racket 5.3.6

2013-10-20 Thread Matthias Felleisen
sider using Shriram's PLAI; it's the grandson of EOPL and supported by some Racket devs. -- Matthias On Oct 20, 2013, at 1:43 PM, Kurt Krebsbach wrote: > Hi, > > I’ve been using EOPL2 to teach Programming Languages for a dozen years now, > and am having a great dea

Re: [racket] Small and short-lived data structures

2013-10-21 Thread Matthias Felleisen
n the most mathematical manner and consult OC to see how to squeeze the most out of this style. When I found that certain styles don't get optimized the way I expect them to get optimized, I would ask the Racket devs whether they could make improvements so that specific functions/programs work better. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Small and short-lived data structures

2013-10-21 Thread Matthias Felleisen
WIth respect, I think this shows nothing :-) On Oct 21, 2013, at 2:35 PM, Sam Tobin-Hochstadt wrote: > On Mon, Oct 21, 2013 at 12:47 PM, Matthias Felleisen > wrote: >> >> In general, it is a mistaken assumption however that even in a >> 'managed'

Re: [racket] Suggestion: Allow above, beside etc. to accept a single image.

2013-10-22 Thread Matthias Felleisen
ither -- Matthias On Oct 22, 2013, at 8:14 AM, Robby Findler wrote: > I did this explicitly because (I believe) it helps with parenthesis errors > when beginning students make simple mistakes using the library. For more > advanced programmers, it seems straightforward to defi

Re: [racket] Small and short-lived data structures

2013-10-22 Thread Matthias Felleisen
u will want to iterate over these things or access fields via computation. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] HTDP 2nd edition exercise 4.2.3 - floating point issues

2013-10-22 Thread Matthias Felleisen
;; equation3 : number -> boolean ;; to determine whether n is a solution for 2n^2 = 102 (define (equation3 n) (=~ (* 2 n n) 102 .001)) -- Matthias On Oct 22, 2013, at 8:40 AM, Bo Gus wrote: > equation 2 is 2n^2 = 102 so I implement like this: > > ;; equation3 : number

Re: [racket] HTDP 2nd edition exercise 4.2.3 - floating point issues

2013-10-22 Thread Matthias Felleisen
Hi BoGus, fwiw, this exercise is NOT in HTDP 2nd edition but HTDP 1st edition, 1-4th printing. Just in case you really want to work through HtDP 2e. -- Matthias On Oct 22, 2013, at 8:53 AM, Matthias Felleisen wrote: > > ;; equation3 : number -> boolean > ;; to determi

Re: [racket] struct contract violation problem

2013-10-23 Thread Matthias Felleisen
On Oct 23, 2013, at 6:25 PM, Erik Pearson wrote: > Excuse my poor experience with contracts, this is probably an easy one. > > I'm using a copy of net/url and have a strange problem. The copied library is > working fine in general, but this problem cropped up today: > > struct:exn:fail:con

Re: [racket] struct contract violation problem

2013-10-23 Thread Matthias Felleisen
Or you defined (struct url ...) somewhere :-) On Oct 23, 2013, at 6:31 PM, Jay McCarthy wrote: > Here are two ideas. > > 1) You simply have an old use of the original net/url. When # is > printed, it uses the symbolic name and you can't really figure out > what the underlying code came f

Re: [racket] Small and short-lived data structures

2013-10-24 Thread Matthias Felleisen
: http://www.ccs.neu.edu/racket/Performance/ [I know Sam knows all this because he's my student, and I simply expressed my frustration that he'd write a message that is so totally inconsistent with his knowledge.] -- Matthias On Oct 24, 2013, at 6:44 AM, Gustavo Massaccesi wrote:

Re: [racket] Numbers with dimensions

2013-10-26 Thread Matthias Felleisen
(y)) (if (eq? yard d) (yard (meter->yard y)) x)])) ;; auxiliaries (define (yard->meter v) (* .9 v)) (define (meter->yard v) (/ v .9)) -- Matthias On Oct 26, 2013, at 7:20 AM, Laurent wrote: > Ok, so I just hacked together a small lib for handling numbers with unit > symbol

Re: [racket] Numbers with dimensions

2013-10-26 Thread Matthias Felleisen
1. I would hope that some generics might help here. 2. I see a need for struct mixins here because meter isn't a refinement per se but some 'attribute'. Then you could mixin several different units and I may have both m and m-1. Data representation not fully thought thru. -- M

Re: [racket] Numbers with dimensions

2013-10-26 Thread Matthias Felleisen
see some experimentation here because people haven't explored the space much and Racket could help explore a #lang metric/racket and even #lang typed/metric/racket. -- Matthias On Oct 26, 2013, at 11:36 AM, Matthias Felleisen wrote: > > 1. I would hope that some generics mig

Re: [racket] Confused between strings and symbols

2013-10-27 Thread Matthias Felleisen
You may wish to read through HtDP/2e: http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html strings: "silly" symbols: 'silly all lists are made from cons and empty, list quote ' quasiquote ` unquote , are abbreviations that expand to lists: http://www.ccs.n

Re: [racket] frequent crashes on Windows 7 64-bit

2013-10-29 Thread Matthias Felleisen
Once I had fixed the typo in your program, I was able to run this loop without ado: > (for ((i (in-range 9))) (collect-garbage) (collect-garbage) (time (main i))) cpu time: 1 real time: 1 gc time: 0 cpu time: 5 real time: 6 gc time: 0 cpu time: 9 real time: 9 gc time: 0 cpu time: 77 real time:

Re: [racket] frequent crashes on Windows 7 64-bit

2013-10-29 Thread Matthias Felleisen
Okay this suggests it's a Window's problem because I am running on a Mac desktop with half the memory and I can go to 9 or 10. I have cc'ed Ryan who created and maintains the DB support. Perhaps he can narrow down the problem. Thanks for the wishes -- Matthias On Oct 29

Re: [racket] Possible typos in HtDP2e

2013-11-02 Thread Matthias Felleisen
Thanks, fixed and pushed. -- Matthias On Nov 2, 2013, at 6:39 AM, Laurent wrote: > From a question on StackOverflow [1], it seems that on this page: > http://www.ccs.neu.edu/home/matthias/HtDP2e/part_4.html > unsyntax `#,' appears 3 times, in places where it should probably no

Re: [racket] Possible typos in HtDP2e

2013-11-02 Thread Matthias Felleisen
site. > > Laurent > > > On Sat, Nov 2, 2013 at 3:02 PM, Matthias Felleisen > wrote: > > Thanks, fixed and pushed. -- Matthias > > > > On Nov 2, 2013, at 6:39 AM, Laurent wrote: > > > From a question on StackOverflow [1], it seems that on this pa

Re: [racket] realm of racket

2013-11-03 Thread Matthias Felleisen
Please work your way thru HtDP/2e first. Realm assumes people have seen a full course on programming (2e is almost complete) and have the maturity to work through some typical first problems. When you're done Realm will be just fine for you. -- Matthias On Nov 3, 2013, at 6:19 AM,

Re: [racket] question on pluggable modules

2013-11-03 Thread Matthias Felleisen
I tend to define such constants in a file dubbed 'basics' and require it everywhere. See https://github.com/mfelleisen/Acquire for example. There 'basics' contains the constants I need for most of the game implementation and some simple functions too. -- Matthias

Re: [racket] Resources for understanding Racket’s language model?

2013-11-05 Thread Matthias Felleisen
s a monad for bridging the gap between the two styles. (Not Racket language model per se but it's not clear what you're really interested in.) -- Matthias On Nov 5, 2013, at 8:01 AM, Sam Tobin-Hochstadt wrote: > In general, papers here: http://www.ccs.neu.edu/racket/pubs/ and also &g

Re: [racket] Implementation of Simpson's Rule (SICP Exercise 1.29)

2013-11-06 Thread Matthias Felleisen
oldl + 0 l)) ;; [List-of Number] -> Number ;; add numbers from right to left (check-expect (sumrl '(1 2 3)) 6) (define (sumrl l) (foldr + 0 l)) Then apply the two functions to JANUS. Enjoy -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Best way to propose changes to Scribble CSS files

2013-11-09 Thread Matthias Felleisen
Lovin' it. I am writing the draft of HtDP/2e in Scribble: http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html and I have had several requests for the content menu to slide along in the left margin. I think it would be okay if searching remained at the top, and the content menu

Re: [racket] dynamically auto-initialized private struct fields

2013-11-10 Thread Matthias Felleisen
Have you considered classes instead of structs? -- Matthias On Nov 9, 2013, at 12:50 PM, David T. Pierson wrote: > Hi all, > > Sometimes when defining struct types it is useful to have fields which > are essentially "private" to the module (fields whose accessors/mutat

Re: [racket] simple genetic algorithm

2013-11-10 Thread Matthias Felleisen
I think this is the program you want: #lang racket (module+ test (require rackunit)) ;; [List-of Real] -> [List-of Real] (module+ test (check-equal? (roulette-wheel-ratio '(1 2 3)) '(1/6 2/6 3/6))) (define (roulette-wheel-ratio generation-fitness) (define total-population-fitness (f

Re: [racket] Common Lisp or Racket?

2013-11-12 Thread Matthias Felleisen
Lawrence, let me supplement Alex's answer. if you have programmed before, dive right into Realm. If it is your first real adventure in programming, take the time to work through HtDP. -- Matthias On Nov 12, 2013, at 12:47 PM, Alexander McLin wrote: > Racket is truely a great and

Re: [racket] turning input-port into file-stream port

2013-11-13 Thread Matthias Felleisen
On Nov 12, 2013, at 11:55 PM, David T. Pierson wrote: > Do you really need a file stream port and not just an input port? Vlad, are you looking for pipes? Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Common Lisp or Racket?

2013-11-13 Thread Matthias Felleisen
for Realm. Is it written for kids? I > have already spent some time in Racket and want to read some idiomatic Racket > code. Is it a suitable book? > > Thanks, > Ben > > > On Wed, Nov 13, 2013 at 3:20 AM, Matthias Felleisen > wrote: > > Lawrence, let me su

Re: [racket] rudimentary Q. about lambda + contracts

2013-11-13 Thread Matthias Felleisen
Do you want something like this : #lang racket (define-syntax-rule (lambda/contract (x ...) c e0 e ...) ;; ==> (let () (define/contract (f x ...) c e0 e ...) f)) ;; - (define g (lambda/contract (x) (int

Re: [racket] Newbie question about local

2013-11-13 Thread Matthias Felleisen
local is a teaching construct that ensures that the semantics of locally defined functions is 100% in sync with 'globally' defined functions. An experienced programmer may ignore local completely. -- Matthias On Nov 13, 2013, at 3:52 PM, Manfred Lotz wrote: > > (defin

Re: [racket] serializability of ISL structures?

2013-11-16 Thread Matthias Felleisen
Kind of. If this is about Universe programming (so that students can send messages back and forth), I have them write conversion functions: (define-struct hh (cakes henries)) (define (hh->lists hh) (list (cakes->lists (hh-cakes hh)) (henries->lists (hh-henries hh -- Matthi

Re: [racket] serializability of ISL structures?

2013-11-16 Thread Matthias Felleisen
tions. I do not believe that they are actually > serializable, but we could fairly easily make that change. > > On Sat, Nov 16, 2013 at 10:22 AM, Matthias Felleisen > wrote: >> >> Kind of. If this is about Universe programming (so that students can send >> messages

Re: [racket] Separate files in the HtDP languages?

2013-11-17 Thread Matthias Felleisen
ve single files for solutions. The former helps with the latter. The former is important for weaker students. In my own courses, I switch partners between assignments for which you may need to repair (not include) code from previous assignments. -- Matthias On Nov 16, 2013, at 8:39 PM,

Re: [racket] Using separate files as modules with HtDP

2013-11-17 Thread Matthias Felleisen
ck, they need to switch partners, they need to explain code to each other and decide which code base to move forward with. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] [plt-edu-talk] Using separate files as modules with HtDP

2013-11-17 Thread Matthias Felleisen
e. I tried doing this using > > >> "require", but I cannot figure out how to get "require" to load a file > > >> that is written in Intermediate Student Language. Is there another > > >> mechanism I should try? Is the thing I want to do even poss

Re: [racket] Should we _always_ use `only-in` or `prefix-in` when `require`-ing packages?

2013-11-18 Thread Matthias Felleisen
In my experience, using plain require and later adding 'except-in' when a service module decides to widen its interface is a much simpler approach than pre-emptively using 'prefix-in' or 'only-in', especially if you need (almost) everything from a (possib

Re: [racket] Should we _always_ use `only-in` or `prefix-in` when `require`-ing packages?

2013-11-18 Thread Matthias Felleisen
people to repair against 'widened' APIs as soon as possible i.e. you'd file a but report against one of these packages. -- Matthias On Nov 18, 2013, at 11:56 AM, Greg Hendershott wrote: >> In my experience, using plain require and later adding 'except-in' when

Re: [racket] contracts on liberal function inputs: avoiding duplicate effort

2013-11-18 Thread Matthias Felleisen
I think the proper interface to offer is to separate the interfaces: -- one function that works on normalized interfaces and for that you use rgb-color/c -- other function(s) that work on liberal inputs and clients know they may pay the cost for double-normalization On Nov 18, 2013,

Re: [racket] [plt-edu-talk] Using separate files as modules with HtDP

2013-11-18 Thread Matthias Felleisen
On Nov 18, 2013, at 3:15 PM, Norman Ramsey wrote: >> This is easily doable with a teachpack: >> >> 1. how to create a teachpack >> http://docs.racket-lang.org/htdp/index.html?q=teachpack >> >> 2. the key is to document the (a) structure type definition and (b) the >> data definition you expo

Re: [racket] Another Canonical Use of Macros?

2013-11-23 Thread Matthias Felleisen
n terms of > the "three canonical categories" that Matthias described--apologies if I'm > misrepresenting him/you: > - changing evaluation order, > - implementing a data sublanguage, and > - creating new binding forms. [That's correct. I used to say 'quoti

Re: [racket] How to make racket to show the call stack when get an exception?

2013-11-23 Thread Matthias Felleisen
(add1 (sub1 ((list 1 2 3 application: not a procedure; expected a procedure that can be applied to arguments given: '(1 2 3) arguments...: [none] context...: /Users/matthias/plt/racket/collects/racket/private/misc.rkt:87:7 So what language are you specifyi

Re: [racket] Learning Scribble

2013-11-23 Thread Matthias Felleisen
tep off the beaten path takes people by surprise. If anyone has time to draft such a document, I'd be happy to play editor. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Matthias Felleisen
surveying some of the Rust macros, and roughly categorizing them in terms of > the "three canonical categories" that Matthias described--apologies if I'm > misrepresenting him/you: > - changing evaluation order, > - implementing a data sublanguage, and > - creating new

Re: [racket] One accessor for the same fields of different structs?

2013-11-25 Thread Matthias Felleisen
Or match and define-match and define/match if you wish to avoid writing selectors. On Nov 25, 2013, at 9:35 AM, "William J. Bowman" wrote: > Ben, > > I'm not sure what problem you're actually trying to solve, but you may want > to look at > > 0) struct super-type > http://docs.racket-l

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Matthias Felleisen
Yes! On Nov 25, 2013, at 11:31 AM, Greg Hendershott wrote: >>> Thanks for the insights. But what does "data sublanguage" mean? >>> >> Say you want a three-state machine where the states are labeled 'go, 'stop, >> 'warning and you use a stream of signals to switch between states say >> 'b

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Matthias Felleisen
g about an identifier' -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] FYI: A new Racket-powered startup

2013-12-02 Thread Matthias Felleisen
Congrats, looks neat! Getting a scribbled pdf from a web site is something different. Have you considered displaying it as HTML for account holders? On Dec 2, 2013, at 7:01 AM, Daniel Prager wrote: > A few hours ago my new start-up -- www.youpatch.com -- came out of stealth > mode. > >

Re: [racket] DrRacket GUI tutorial with MVC concepts?

2013-12-17 Thread Matthias Felleisen
We call it MVC when we must and it is (kind of) baked into the big-bang approach in the Program by Design curriculum. But we don't use pattern terminology all that much -- Matthias On Dec 14, 2013, at 7:05 PM, Geoffrey S. Knauth wrote: > My son, who I'm afraid/inspire

Re: [racket] testing impure stuff

2013-12-22 Thread Matthias Felleisen
> > How do other people create test cases for impure situations? I have written such a program several years ago (a primitive version) and I tested it by writing another program that generated tmp directories with certain characteristics. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] testing impure stuff

2013-12-22 Thread Matthias Felleisen
Yes. There is a (simple) hidden file/directory simulator in the works inside of 2htdp/batch-io for novices to test such things. Nothing you could use but Robby's right and his message recalled my (aborted) effort from last year -- Matthias On Dec 22, 2013, at 3:52 PM, Robby Findler

Re: [racket] testing impure stuff

2013-12-23 Thread Matthias Felleisen
On Dec 23, 2013, at 2:10 PM, Manfred Lotz wrote: > On Mon, 23 Dec 2013 13:53:05 -0500 > Greg Hendershott > wrote: > >> On Sun, Dec 22, 2013 at 2:49 PM, Neil Van Dyke >> wrote: >>> Manfred Lotz wrote at 12/22/2013 01:54 PM: Or perhaps even better create my directory structure on the fly

Re: [racket] testing impure stuff

2013-12-23 Thread Matthias Felleisen
For that, you will need to wrap the whole loop because (in-directory ...) fails, and no, I don't know how to resume this optimized loop: #lang racket ;; foo.rkt (define start-dir ".") ;; (with-handlers (((lambda (x) #t) (lambda (e) (log-warning "in-directory failed" (for ([f (in-direc

Re: [racket] testing impure stuff

2013-12-23 Thread Matthias Felleisen
Sadly, I think you may have to re-implement in-directory (with a recursive traversal like the one in for.rkt) but use file-or-directory-permission before you try to go into a subdirectory. -- Matthias On Dec 23, 2013, at 4:09 PM, Manfred Lotz wrote: > I had a look into collects/rac

Re: [racket] testing impure stuff

2013-12-23 Thread Matthias Felleisen
On Dec 23, 2013, at 5:12 PM, Manfred Lotz wrote: > I think in-directory should be fixed in the long run. Agreed. -- Matthias Racket Users list: http://lists.racket-lang.org/users

Re: [racket] testing impure stuff

2013-12-23 Thread Matthias Felleisen
parameter. It would generalize this situation -- Matthias On Dec 23, 2013, at 5:53 PM, Robby Findler wrote: > Perhaps in-directory can take an optional parameter that controls whether or > not to recur? > > Robby > > > On Mon, Dec 23, 2013 at 4:42 PM, Matthias Felleisen

Re: [racket] contracts on functions that take arbitrary keyword arguments

2013-12-27 Thread Matthias Felleisen
This is a bit vague. Can you clarify the question with a concrete example? On Dec 26, 2013, at 7:45 PM, "Alexander D. Knauth" wrote: > I want to make contracts on some apply-like functions that check some > arguments but just passes all the others (including keyword arguments) on to > a fun

Re: [racket] scribble support for dynamic content

2013-12-27 Thread Matthias Felleisen
Scribble allows programmers to create their own 'styles' and within a CSS style you can certainly refer to JS components. Search for 'style' in the docs (e.g. raco doc style) and peruse the scribble notion of style. -- Matthias On Dec 27, 2013, at 3:36 PM, Martin

Re: [racket] How to view source code of procedures? MIT scheme "pp" equivalent?

2013-12-27 Thread Matthias Felleisen
> rudimentary expressions. This might be a MIT misunderstanding about the relationship between Scheme and the lambda calculus. It is certainly not possible in general and I see no pragmatic use case for an approximation. -- Matthias > > For example: >

Re: [racket] Would someone prefer paredit shortcuts?

2013-12-27 Thread Matthias Felleisen
Do you want to turn it into a package: (1) http://pkgs.racket-lang.org/ (2) http://docs.racket-lang.org/pkg/?q=package -- Matthias On Dec 27, 2013, at 11:03 AM, 钟 wrote: > I used to write lisp code in emacs and enjoy paredit-mode.I tried to find an > alternative for DrRacket but

<    1   2   3   4   5   6   7   8   9   10   >