Re: [racket] Off-topic: Scheme for JVM?
All I know is what I read here: http://googleresearch.blogspot.com/2009/08/under-hood-of-app-inventor-for-android.html shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Off-topic: Scheme for JVM?
> [...] and a scripting language for the App Engine. That would be news to me! Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] How can I save all the definitions in racket to a file?
Is it running Racket underneath? On Thu, Jun 24, 2010 at 2:20 PM, Jose A. Ortega Ruiz wrote: > On Thu, Jun 24 2010, Insik Cho wrote: > >> I see. >> >> Do you think if emacs is a good tool for editing, saving and executing >> racket programming? >> >> I prefer command-like environment to GUI. But, It's inconvenient to >> edit a file and enter! it separately in a shell. >> >> What environment or editor are you using for racket programming? > > If you're familiar with Emacs, you might give Geiser a try (full > disclosure: i'm Geiser's author). See http://www.nongnu.org/geiser for a > bit of documentation (once i finish writing the user manual, i'll make > the first relase; for now, you may consider it beta quality :)). > > (As an aside, and answering to another thread, Geiser let's you send > individual sexps to the REPL, among other things). > > Cheers, > jao > > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Racket & Netbook
I find DrRacket very hard to use on older machines and netbooks. I recently upgraded to an Acer Aspire 1810T. This is about $600 and has a netbook form factor (same chassis as the 1410T, which is their netbook). The 1366x768 screen makes the keyboard nice and wide and great for use in travel. What's good about it is that it has a real (non-Atom) dual-core processor, and I got it with 4Gb RAM. (It also has an HDMI output port, and 3 USBs.) It's been absolutely wonderful, and I finally understand how people can work with DrRacket instead of Emacs. Now I launch DrRacket with impunity. This was a great buy, because it costs about a 1/3 of a "proper" laptop but has enough computing for many of my tasks. It was very hard to find something between netbook and notebook, and all the reviews I saw indicated that Acer had found that sweet spot. I bought it, and can confirm it's true. Of course, you won't get Apple-level support from Acer. But that cuts both ways (Acer support staff don't assume they are inherently more advanced genetic beings). Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] two languages at a time in DrRacket
Surely someone here has done something like this before, and I'd like advice on how to do it. We're in the process of converting Margrave, our security analysis tool, over to Racket, and to exploit DrRacket as its user environment. What we'd like to be able to do is this: in DrRacket, Interactions Window: Click Run to "load" this policy Definitions Window: That is, just as the REPL explores the values of the program in the definitions window, the policy query language explores the firewall policy in the definitions window. One analogy might be that it's like writing a Java program up top, and using Scheme in the REPL to explore it. But that's only an analogy as far as syntax goes. Semantically, our problem is worse (in the Java case, one could compile the Java into Scheme, a la ProfJ; we don't even have such a common intermediate language; the policy compiles to first-order models, and the query runs against them). Any thoughts on how to structure such an interaction? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Racket & Netbook
Paul, You can already run WeScheme on your Android: http://www.wescheme.org/ Due to a complete rewrite this summer, WeScheme and Racket will come ever closer together. But I may be misunderstanding what you mean by "client". Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] two languages at a time in DrRacket
"easy" is great. I assume I should ignore the comment that says ; XXX This is almost certainly wrong. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system?
> The only thing needed beyond creating the tarball is an > info.rkt file. You underestimate the Scheme "community"'s ability to divide. The controversy will shift entirely to what is acceptable in info.rkt files. Soon you will end up with the Revised^n Reports on the Racket Information File Format, which will be accused of all sorts of unSchemely practices like being too static, allowing square brackets, etc. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system?
> But I doubt raco could understand a .plt file that was > un-base64-encoded to just be a .tar.gz. There are language implementations that can import directly from zip files... JARs *use* zip, but Python can load directly *from* zip. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system?
I'm told Gambit does, too. On Sat, Jul 3, 2010 at 8:19 AM, Shriram Krishnamurthi wrote: >> But I doubt raco could understand a .plt file that was >> un-base64-encoded to just be a .tar.gz. > > There are language implementations that can import directly from zip > files... JARs *use* zip, but Python can load directly *from* zip. > > Shriram > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] why isn't this a list?
http://docs.racket-lang.org/guide/hash-reader.html > #reader"five.rkt"abcde "abcde" Why is the string "abcde" not in a list? _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] scoping rules and define-for-syntax
I don't quite know where to read to understand, and to work around, the following scoping rules. Here's a very simple module (details not important, only the functions being define-for-syntax'd): (module my-new-syntax racket (provide (except-out (all-from-out racket) lambda) (rename-out (my-lambda lambda))) (require (for-syntax racket)) (define-for-syntax (f3 e) e) (define-syntax (my-lambda e) (syntax-case e () [(_ arg body) ;; _ is lambda (with-syntax ([not-transformed-body (f3 (syntax body))]) (syntax (lambda arg not-transformed-body)))]))) If I load this module and run run (module tester 'my-new-syntax (define f (lambda (x) x x))) in the definitions window I get a syntax error, whereas for (module tester 'my-new-syntax (define f (lambda (x) x))) I don't. So far, so good. However, if I change the source of my-new-syntax to be (module my-new-syntax racket (provide ... same as before ...) (require ... same as before ...) (define-for-syntax (f1 e) (f3 e)) (define-for-syntax (f3 e) e) (define-syntax (my-lambda e) ... same as before ...)) and Run, I get expand: unbound identifier in module (in phase 1, transformer environment) in: f3 highlighting the use inside f1. If I swap the order of definitions of f1 and f3, this works fine. This, however, is just an illustrative simplification of my real program, which has non-trivial mutually-referential functions. The only solution I have is effectively (define-for-syntax (shell e) (define (f1 e) ...) (define (f3 e) ...) (f3 e)) which works, but is pretty unsatisfactory. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] universal Pong question
Would it help you to have a Battleships in Universe as an example? On Jul 25, 2010 3:27 PM, "Todd O'Bryan" wrote: > In the three-week intro course I'm teaching, the students have > expressed a desire to program Pong played over the network, so that > they can play against each other when they get home from camp. > > I've never done universe programming before, so I'm not sure what kind > of messages the worlds should send back and forth. > > Obviously, each world needs to report on the position of the paddle > (left or right) that its player controls, but what about the ball? > Should I just let the worlds handle that with on-tick, or should I > check that the ball is in the same spot on both worlds every so often, > or should I have the universe server control the ball and tell the > world everything except their own paddle position each time something > changes? > > I think all of these are reasonable choices, but I'm pretty sure some > will be more or less nice in terms of performance, so I'd like not to > head down a blind alley. > > Todd > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] writing a define-world macro
Todd, Danny has defined updaters for his world. However, the reason we didn't make these public is because we ultimately need to deal with lvalues, which (a) are arguably not a good idea, and (b) we certainly can't do as a macro anyway. Make sure you think about that. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] writing a define-world macro
Generalize. On Sun, Jul 25, 2010 at 9:47 PM, Todd O'Bryan wrote: > Huh? > > Are you talking about the set-posn-x! and set-posn-y! mutators or > something else? > > I just want something of the form: > > ;; posn-update-x: posn number -> posn > ;; posn-update-y: posn number -> posn > > Completely non-mutational--just recreates the exact same structure, > except for the updated value. > > Which lvalues am I missing? > > Todd > > On Sun, Jul 25, 2010 at 6:44 PM, Shriram Krishnamurthi > wrote: >> Todd, >> >> Danny has defined updaters for his world. However, the reason we >> didn't make these public is because we ultimately need to deal with >> lvalues, which (a) are arguably not a good idea, and (b) we certainly >> can't do as a macro anyway. Make sure you think about that. >> >> Shriram >> > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] writing a define-world macro
If you're satisfied with that, then simple updaters will do the trick, and you'll be fine. But in practice you tend to have complex nested structures, and this form of updaters turns out to be rather less useful. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] importing signatures
Here's the file "sig": #lang racket (define-signature Foo (make-foo foo?)) Here's another file: #lang racket/unit (require "sig") (import) (export Foo) (define-struct foo ()) When I execute this, I get define-unit: unknown signature in: Foo I would have thought that the the signature is precisely what the (require "sig") line would have imported. I must be missing something in the grammar -- anyone? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] module-path=?
Funnily enough, I asked Matthew a similar question earlier this evening. Without permission, I quote his reply: >> When do two module designators designate the same module? > Do you mean "the same for any installation" or "the same for the > current installation"? > > For the former: normalize each module path using `collapse-module-path' > and compare the results using `equal?'. > > For the latter: build a module path index using > `module-path-index-join', resolve it using `module-path-index-resolve', > and then compare the resolved paths using `eq?'. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] more liberal CSV parsing?
Neil's superb CSV reader seems to unfortunately conflict with the notion of CSV on the OS that maybe loves CSV the most: Windows. I spent a while tracking down a CSV reader failure, and was able to isolate it to the program below: #lang racket (require (planet neil/csv:1:6/csv)) ((make-csv-reader "\"x\" a")) Output (error): [csv-reader] : Erroneous CSV format: Junk after close of quoted field: #\/ In other words, Windows sometimes produces CSV that looks like this: d1,d2,"foo" bar,d3 It appears that Neil's reader (undoubtedly rightly) barfs on text beyond the closing quote and space. Do one of the options in the library parameterize against this behavior? It doesn't appear so And sadly, I certainly have no hope of changing Windows. (-: - Neil, if you want a concrete context, try the output of wmic process get commandline /format:csv on Windows 7. You get lines like ROUBAIX,"C:\Program Files\Windows Sidebar\sidebar.exe" /autoRun,2940 ROUBAIX,"C:\Users\sk\Local Settings\Apps\F.lux\flux.exe" /noshow,3048 Mmph: it looks like the output may be just plain broken. I see another line that looks like ROUBAIX,cthelper 49170 xterm :erase=^?:size=24,80,4064 which looks like it has one field too many Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket-users] parts as the top-level unit in books
The Scribble Book format https://docs.racket-lang.org/scribble/Book_Format.html?q=scribble%20book has the *chapter* as the highest-level unit. For a book with lots of chapters, it's useful to have a higher-level unit, like a *part*. (E.g., *How to Design Programs* is broken down by parts, and the parts contain chapters.) What's the cleanest way to configure Scribble to do parts atop chapters? Thanks, Shriram -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/81334a4e-d6a8-42a5-90b6-212633c39fb0n%40googlegroups.com.
Re: [racket] New user wanting to know where to go
Stephen Bloch mentioned his book Picturing Programs. I am happy to recommend it, too, so you don't think only its author likes it: http://picturingprograms.com/download/ It has many similarities to, but also some real differences from, both HtDP and HtDP 2/e. At a *very* coarse level, HtDP: numbers first HtDP 2/e: animations first PP: lots of images first, animations somewhat later It's great that we have so many different choices available for readers; pick the one that works best for you. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] syntax-parse and literals
I am having some trouble figuring out how to use syntax-parse in combination with wanting literals (aka, internal keywords) in a macro definition. I have (syntax-case stx (:) and am trying to achieve a similar effect. I tried (syntax-parse stx #:literals(:) but that resulted in syntax-parse: literal is unbound in phase 0 (phase 0 relative to the enclosing module) in: : I don't see an example of this in the docs. Since I have only one literal, I was hoping to avoid the complexity of literal-sets -- basically, attain the equivalent of the (:) in syntax-case. Thanks! Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] syntax-parse and literals
That fixed the problem, thanks. I was disappointed by some of the resulting error messages, though. I'm bringing these up here because I don't know whether these error messages are an artifact of the strategy Jay suggested. To simplify, suppose I have (define-syntax (defvar: stx) (syntax-parse stx #:literals(:) [(_ i:id : C:expr b:expr) ...])) Here are some errors: (defvar: y : 4) -> defvar:: bad syntax in: (defvar: y : 4) Could have indicated a missing expression? (defvar: y number? 4) -> defvar:: expected the identifier `:' in: number? I have two nits with this: - : is meant to be a literal, not an identifier, and - the prose "expected the identifier `:' _in_ number?" is particularly bad (putting a ":" inside "number?" isn't going to change anything -- it means "in place of" or "before", not "in"). It might have been better to just say that the literal : is missing, and it was expected in the position where "number?" is. (defvar: : number? 4) -> defvar:: expected the identifier `:' in: number? Ditto. It would have been more useful, I think, to indicate that an identifier needs to precede :. Now the literal/identifier confusion seems especially strong because it seems to have taken : for the i:id. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] parse-define-struct too liberal?
parse-define-struct will parse an expression with anything in the "define-struct" position; e.g., (let ([s #'(anything-goes m (a b))]) (parse-define-struct s s)) succeeds. However, it is strict about what goes in the field positions, e.g., it cannot be used to parse (let ([s #'(anything-goes m ([a : 2] [b : 3]))]) (parse-define-struct s s)) Is the conservatism of the head position just an artifact of an _ in a macro, or is it an actual feature that is used for some purpose? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] syntax-parse and literals
I guess to me, the term "literal identifier" is an oxymoron. It's either a literal (5, #f, in this case :) or an identifier (foo, car, +). Unless "identifier" means nothing more or less than "symbol". When I write (:) in syntax-case, I'm saying ": is not a binding form; I want to see literally a :, and I don't want to bind the : in the pattern to whatever you find in that position". I'm trying to reproduce that effect here. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] build-struct-generation
build-struct-generation is a really useful utility, but I don't understand how to use it. Specifically, see Welcome to DrRacket, version 5.1.3 [3m]. Language: racket; memory limit: 128 MB. > (require syntax/struct) > (build-struct-generation #'p (list #'x #'y) #f #f) '(let-values (((struct: make- ? acc mut) (make-struct-type '.# #f 2 0 #f () ;; <--- (current-inspector) #f ( ;; <--- (values struct: make- ? (make-struct-field-accessor acc 0 '.#) (make-struct-field-mutator mut 0 '.#) (make-struct-field-accessor acc 1 '.#) (make-struct-field-mutator mut 1 '.#))) Note the two empty lists in the output [()'s with the default printer; in constructor mode they come out as empty's]. They correspond to props : (listof (cons/c struct-type-property? any/c)) = null immutables : (listof exact-nonnegative-integer?) = null However, these are in code that it meant to subsequently be evaluated. When used, for instance, in a macro, I get #%app: missing procedure expression; probably originally (), which is an illegal empty application in: (#%app) Is it possible to get a simple example of how to use this? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] build-struct-generation
That fix worked -- thanks! Yep, it did have a "mzscheme" whiff about it. It would be good for b-s-g to cross-reference d-s/d (I see a define-struct/derived, not struct/derived) -- I wouldn't have found it from the docs alone. However, I am a little unclear on the value of d-s/d. Is it solely to improve error messages? For all other intents, is it equivalent to writing define-struct without that first syntax object argument? Perhaps a additional sentence in the docs to either confirm this or explain the difference would help. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] splicing into local
I have a define form that expands into two two definitions. Usually I can write (my-define ...) ==> (begin (define ...) (define ...)) However, this doesn't interact well with local. Is there a way of identifying that I'm in a local context and expanding into something else so that this "just works"? [I don't suppose local would be willing to accommodate such forms by splicing begin's...] Naturally, documentation pointers/terms welcome. Thanks. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] splicing into local
I hadn't realized I was getting the wrong local. Your suggestion did the trick and the result made my library far better than I'd hoped. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] recognizing undefined; shared in TR
Is there a way of checking whether a value position is undefined? Specifically, I'm trying to recognize the undefined value put in structures by SHARED. It appears that a undefined value is sometimes EQ? to another one, but this doesn't seem to be specified in the documentation (ie, that there is only one undefined value). Thanks! == Separately, I tried to get inspiration from Typed Racket, but I'm not sure it works well with SHARED even though it's in the TR language. To wit: - #lang typed/racket (define-struct: m ([x : Number])) (shared ([-a- (make-m -b-)] [-b- 3]) -a-) - produces an error at the binding of -a- saying Type Checker: insufficient type information to typecheck. please add more type annotations in: -a- (NB: The error message could use some sprucing up.) So I instead tried (shared ([#{-a- : m} (make-m -b-)] [#{-b- : Number} 3]) -a-) and got several errors: Type Checker: untyped identifier make-reader-graph imported from module in: (shared ((-a- (make-m -b-)) (-b- 3)) -a-) . Type Checker: untyped identifier make-reader-graph imported from module in: (shared ((-a- (make-m -b-)) (-b- 3)) -a-) . Type Checker: Bad arguments to polymorphic function in apply: Domain: a ... a Arguments: Nothing * in: (shared ((-a- (make-m -b-)) (-b- 3)) -a-) . Type Checker: Expression should produce 2 values, but produces 1 values of types Nothing in: (shared ((-a- (make-m -b-)) (-b- 3)) -a-) Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] return value of build-struct-names
The docs for build-struct-names says The result is a list of identifiers: * struct:name-id * ctr-name, or make-name-id if ctr-name is #f * name-id? * name-id-field, for each field in field-ids. * set-name-id-field! (getter and setter names alternate). * I presume this last line () is just a typo? Also, the above text would suggest that all the getters precede all the setters, but if both omit-sel? and omit-set? arguments are given, the getters and setters are interleaved. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] getting the term in syntax-id-rules
In a syntax-case, I can obtain the term being processed: eg, (define-syntax (foo stx) (syntax-case stx () [... (with-syntax ([term stx]) ... #'term)])) In syntax-id-rules, the RHS is like a syntax-*rules*, so I don't know of a way of obtaining access to the source. This would be particularly useful since my id macros are expanding into regular term macros, but I'd like the user to see errors in terms of the id text (which I'm storing in a structure, hence the #'term above). Sorry if I'm missing something obvious; hopefully an archival answer to this will help anyway. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] getting the term in syntax-id-rules
> Is there a reason not to just use `syntax-case' (or even better, > `syntax-parse')? Sheer ignorance, my dear chap. I didn't realize that that worked! (A docs hint may be in order) For those reading this later, here's an example: (define-syntax (String$ stx) (syntax-case stx (String$) [String$ (with-syntax ([term stx]) #'(first-order-sig string? #'term))])) but also note the discussion on the thread "syntax-parse and literals" on why syntax-parse is better than syntax-case (and it's not just because of the parsing). Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] recognizing undefined; shared in TR
On Sat, Sep 3, 2011 at 11:17 PM, Shriram Krishnamurthi wrote: > Is there a way of checking whether a value position is undefined? > Specifically, I'm trying to recognize the undefined value put in > structures by SHARED. It appears that a undefined value is sometimes > EQ? to another one, but this doesn't seem to be specified in the > documentation (ie, that there is only one undefined value). Anyone have any thoughts on this? Is it okay to use EQ? _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] turning off shared printing in pconvert
This program #lang racket (require mzlib/pconvert) (parameterize ([show-sharing false]) (print-convert (shared ([-a- (list 0 -b-)] [-b- (list 1 -a-)]) -a-))) produces this output in 5.1.3: Language: racket; memory limit: 128 MB. '(shared ((-0- `(0 (1 ,-0- -0-) How do I get pconvert to suppress sharing? (The only option I see right now is to supply #t as the second argument to print-convert, so that it suppresses sharing for DAGs and only shows true cycles.) Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] turning off shared printing in pconvert
Just in case my example is misleading, I want to suppress ALL shared printing if possible. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] turning off shared printing in pconvert
I'd be perfectly happy with printing a prefix followed by It's not clear that there's a way to create cycles w/out shared or mutation in the source, but what I'm trying to ensure is that shared doesn't show up in output before I want it to. On Mon, Sep 5, 2011 at 10:09 PM, Sam Tobin-Hochstadt wrote: > What would be printed for cycles? > > On Mon, Sep 5, 2011 at 9:56 PM, Shriram Krishnamurthi > wrote: >> Just in case my example is misleading, I want to suppress ALL shared >> printing if possible. >> _ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users >> > > > > -- > sam th > sa...@ccs.neu.edu > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Why check-expect only at the top level?
I suspect everyone who teaches has run into just such a desire. But there's a "when" problem. We WANT students to be able to write checks before they write the function. That means their file can look like (check-expect (f 10) ...) (define (f x) ...) But if check-expect's just ran like regular code, this would no longer work. So c-e effectively rewrites the file to ... everything else ... ... all the c-e's, wrapped in reporting code ... (as you note in the excerpt you quote). The problem with such a scheme is that it's not immediately clear what to do with those inner c-e's. It's tricky to extract them to the top-level; also, since they are under a lambda, they presumably aren't run until the function does. But that means the expectation that all c-e's were run has been violated. One could imagine alternate interpretations of c-e, but the current one is simple, consistent, and useful. One possibility is that you want to implement some kind of "internal-check-expect" that has the semantics you have in mind; another is that you want to move past c-e to talking about testing and predicates, which is a bigger discussion. An assignment like this may then be of interest: http://www.cs.brown.edu/courses/cs019/2010/assignments/oracle Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Keyboard shortcut for switching between definitions area and interactions window
I thought I saw that (ie, C-x o not working) a few times, but to be sure I tested just now in a fresh DrRacket 5.1.3, and C-x o works for me (phew!). Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] syntax-parse and literals
Thanks for the very informative thread. Piecing together what Asumu, Jay, Robby, and Eli said, I think I understand what's going on, and I think this actually answers a question I asked last year and didn't get an answer to: Why do require and provide export their sub-forms as macros rather than just make them local keywords. What I understand now is that by exporting the sub-forms as macros, one can ensure that the binding structure is just right. I think this is what Jay means when he says "I consider insisting on bindings a feature, because it promotes well-behaved macros". The downside is that a single "feature" now has a whole bunch of exports, and anyone who wants to re-export the feature has to know about and re-export all the other bound names as well. For instance, I can't just re-export "require" -- I have to track all the require sub-forms and re-export those as well. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] beware DrRacket and Dexpot interaction
In Windows 7: Over the past four days I've been using DrRacket intensively. During this time it has crash on me at least twice a day, each time exiting with error code 3 (according to the Puttycyg shell). I eventually noticed that Dexpot (a virtual window manager for Windows), which has otherwise been running fine, seemed to be exhibiting some instability -- not immediately after the DrRacket crashes, but also roughly 1-2 times a day. So I turned off Dexpot entirely. For 1.5 days since, DrRacket has not crashed at all. If you're using Dexpot, you may want to be wary of this. For reference, I was running 1.5.9, Build 1503. I have just upgraded to the latest version/build and will start using the two together again to see whether this continues. [Of course, I can't rule out a hardware failure either.] Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Take an element from a set
This looks like a reasonable way to get an element, but thinking ahead, you will probably want something both like "first" (which you have) and a corresponding "rest". The problem is that which element you get from the "first" operation is nondetermistic in a set. Therefore, you have to either - pass the returned first element to the rest operation, or - accept that (set-union (set (set-item S)) (set-rest S)) is not the same as S A better design would be to use a different signature: get-one/rest : (forall (A) (Set A) -> (values A (Set A))) This performs the split "atomically", so it can ensure that the combination of "one" and "rest" is the same as the original set. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] abstracting over codeblock
I'm trying to convert some old slatex'ed documents into scribble and running into trouble. I don't seem to have a clear enough handle on how to use codeblock. I can, for instance, convert \begin{schemedisplay} foo bar \end{schemedisplay} into @mycode{ foo bar } where @(define(mycode . terms) (apply verbatim terms)) works fine. However, codeblock is syntax, not a function, so I can't just replace "verbatim" with "codeblock" above. I can't replace "apply verbatim" with "codeblock", either: string-append: expects argument of type ; given '("foo" "\n" "bar") It'd be very helpful to see the mycode function such that it uses codeblock and sets the optional line-numbering flag (#:line-numbers ) to 1, say. Thanks, Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] abstracting over codeblock
Thanks: that makes sense. But in that case, setting aside the abstraction issue for a moment, could you explain why @codeblock{ (define (f x) (x "three")) } works as expected -- it colors the sub-parts as the appropriate syntactic categories, not all as string -- but @codeblock[ (define (f x) (x "three")) ] does not: define: not allowed in an expression context in: (define (f x) (x "three")) ? That doesn't quite match my understanding of "`codeblock' expects code, and it's a macro that does the quoting itself". I did see in the Scribble docs the difference between {} and [], but now the interaction between macros (which work top-down) and expressions (which work bottom-up) is not so clear to me. Also, related to this and going back to the abstraction issue, when I type the very thing you suggested: @(define-syntax-rule (mycode code ...) (codeblock code ...)) @mycode[ foo bar] I get: Welcome to DrRacket, version 5.1.3 [3m]. Language: scribble/manual; memory limit: 128 MB. . expand: unbound identifier in module in: foo pointing to the foo inside the [brackets], whereas @mycode{ foo (define (f x) (x "three" 1 #\c)) bar} is handled and colored correctly Thanks! Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] new visual tool for student program understanding
Over the summer, we built a new tool for visualizing program execution: think of it as a complement to the Stepper. It is similar in that it shows you the steps of program execution, what they evaluate to, and thus how the result is obtained (though it focuses only at the level of user-defined functions, ignoring the primitive operations). However, the Stepper presents a linear view of the computation, whereas the Tracer presents a tree-shaped view. It's easiest to understand this by looking at an example, which you can do from the documentation. This also gives you instructions on how to run the Tracer. http://planet.plt-scheme.org/package-source/tracer/tracer.plt/1/7/planet-docs/tracer/index.html Here are some other example programs that you can try out to see the Tracer at work: https://github.com/retief/racket_tracer/tree/master/demos/good_demos Tracer was built by two Brown undergrad students, Jeanette Miranda and William Zimrin. Please let us know if you have any feedback! Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] fruit flies
Robby -- I don't know enough about how the internal drawing routine of DrRacket works, so you could help clarify that. In 2htdp/universe, the act of "movement" is represented by reconstructing the entire scene. Of course, there may be sharing: (define bg ... something complex ...) ;; at time 1 (place-image I 50 50 bg) ;; at time 2 (place-image I 70 70 bg) When this is finally rendered as a single image in the window, how much work is done? Is it proportional to the size of the scene, or is it only proportional to the pixels that changed between the scene at time 1 and the scene at time 2? Does the library perform a diff between the two scene graphs? In Whalesong's web-world, the act of "movement" is represented by a cursor finding the object and functionally updating its CSS. After web-world does its tree-diff, it uses a *mutative update* to change the CSS attributes. My understanding is that the browser DOM implementation then uses this information to update the screen as efficiently as possible (using Z depth to avoid unnecessary redraws, clipping, bitblit, etc). Thus, in web-world, the amount of work should be proportional to the number of affected pixels and *independent* of the number of unaffected ones. Is this true of 2htdp/image/universe? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] fruit flies
Time isn't the only measure. And in terms of space, I don't think you're accounting for all of it. When you make universe scenes bigger, you tend to see GC pressure. This *suggests* to me that there is not a lot of sharing from one display to the next; rather, an entire WIDTHxHEIGHT bitmap is being generated (and thrown away) each time. Yet I'm pretty certain this is not how the DOM works. That means the space difference is much more than the space for representing the circles. At least on laptops, increasing the size of the scene seems to induce more GC, and for large enough images the GC can actually induce a pause in an animation. I'm pretty sure this is a qualitative difference between the two models. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] I don't understand structural recursion.
Hi Charlie, Yep, Catalan numbers! Here's something that may help. Add the following two lines to the top of your file -- #lang planet tracer/tracer (trace-all) -- and put a concrete call at the end, eg: (num-distinct-trees 3) Go to Language | Choose Language... and select the option at the top (Use the language declared in the source). When you Run the program, this will fire up a browser window which will visualize the calls you're making and the answers they're returning, as trees. (If you modify your program to return the actual trees, not just the counts, you can see them printed as values, too.) Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] I don't understand structural recursion.
I understand. It would help if you could tell me what would have been useful to drop from the output -- this feedback helps us a great deal. There is *some* configurability: - no trace command = just run the program - (trace-all) - (trace-failed-checks) = just the tests that failed - (trace-explicit) = failing checks and (trace ...) expressions See: http://planet.plt-scheme.org/package-source/tracer/tracer.plt/1/7/planet-docs/tracer/index.html If what you want is to view only some calls (eg, num-distinct-trees but NOT accumulate), however, that still doesn't help. But because the tracer gives you the top-down view of evaluation, you can at least safely skip over calls you're not interested in (though they are still taking up screen and brain acreage). There is actually a way of obtaining the above effect. The tracer only traces functions in the current module. So if you wanted num-distinct-trees but not accumulate, you could move accumulate to another module, export it from there, and import it here. Of course, that is a pretty clumsy thing to have to do in the middle of trying to solve a different problem; but for a project where the tracer is essential, at least it gives you *a* way to accomplish this. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Quoted expressions in #lang racket
Yep, that's what he's saying. I know why you're confused. Let me see if I can help. Here's an input program: '(1 2 3) Now be careful to make the following distinction: - what it computes - what it prints What it computes is a list with three values. There are at least three different ways to PRINT this: 1. (1 2 3) 2. # 3. (quote (1 2 3)) The first has the disadvantage Matthias pointed out: you can't paste the value back in in a bigger computation. The second has the same disadvantage. The third has the advantage you can paste it back in. You're probably concerned that pasting it back in "makes a new list". Yes, it does. But if the expression '(1 2 3) were part of some bigger computation -- eg, (length '(1 2 3)) -- then no "new list" would be created. So it's only if you try copying the output of one computation as the input of another that there might be new allocation. But look at the word I just used: "copy". This isn't the full answer, but I think you need to make sure you've got at least these steps under your belt before we go further. Do ask questions. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Quoted expressions in #lang racket
I used different words than Matthias because we were trying to offer somewhat different explanations of what is happening. You chose to use his words in response to mine, which only confuses things further. (There is, incidentally, a good reason why (+ 1 2) could, but does not, evaluate to (+ 1 2).) But overall, since I appear to be talking nonsense, I'll avoid following-up and aggravating you further. Good luck. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Quoted expressions in #lang racket
You keep thinking (1 2 3) is the canonical form of a list. It is not. It's just a particular *print representation* of list. So is # or one of the many alternatives Eli proposed. Your attempt to use an interpreter model is commendable but falls short. That is because you only described the READ and EVAL steps of a REPL. The L(oop) is not relevant here, but the P(rint) is actually the most critical part, and that's the one you left out of your attempt at explaining what's happening. Also, Matthias asked you about substituting answers inside bigger expressions. You gave him a mechanical answer of why (you think) it won't work, but you failed to understand the bigger point he was trying to make in the first place. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Off topic: A curriculum (books, papers, essays) for how to design and implement compilers and interpreters?
It depends on what kinds of compilers/interpreters they were trying to build. A course of study for Fortran would like quite different from one for ML would look quite different from one for JavaScript (though there are of course many overlaps). Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Quoted expressions in #lang racket
> It's just that I don't understand why you (i.e. > Racket implementers) choose Racket by default prints list this > way (different than all other lisps). I think this choice can confuse > [...] users who switches from different lisp > implementations [...] Then it nicely accomplishes the task of alerting them that there are many more surprises ahead. (If Racket were just the same as some other Lisp, it would have no need to exist.) Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Quoted expressions in #lang racket
We are not teaching Lisp. We're teaching Racket. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Quoted expressions in #lang racket
> Ok, maybe this is not something that's important in other programming > languages, but it *is* important in lisps. As a lisp educator, how can you > *not* to teach this fundamental fact about lisp? It's funny that here you're berating Robby, who's put more time into different ways of printing than anyone I can think of in the Lisp community. Take a look at the options offered in the "Show Details" part of language selection. In particular, the quasiquote representation is probably a better way to help students understand the issues you think are vital. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] using scribble --pdf on Windows
On Windows 7, I have had no trouble using scribble --html. For the first time in 5.1.3 I tried using scribble --pdf, and it does not work. Does anyone recognize whether I'm doing something wrong? ventoux ~/Desktop/r/sk/tycs> scribble --pdf doc.scrbl run-pdflatex: did not generate a log file at doc.log === context === C:\Program Files (x86)\Racket\5.1.3\collects\scribble\private\run-pdflatex.rkt:25:2: loop C:\Program Files (x86)\Racket\5.1.3\collects\scribble\private\run-pdflatex.rkt:7:0: core C:\Program Files (x86)\Racket\5.1.3\collects\scribble\private\indirect-renderer.rkt:38:8: for-loop C:\Program Files (x86)\Racket\5.1.3\collects\scribble\run.rkt:105:0: build-docs C:\Program Files (x86)\Racket\5.1.3\collects\scribble\run.rkt: [running body] The problem can't be with finding the pdflatex executable, because the expression used in scribble/private/run-pdflatex.rkt finds it fine: > (or (find-executable-path "pdflatex") (and (eq? 'windows (system-type)) (find-executable-path "pdflatex.exe"))) # Anyone else seeing this problem? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] red underline of language name
In #lang scribble/manual, if I type @codeblock{ #lang racket } the output (in HTML) has the word "racket" underlined, which seems fair enough; ditto for @codeblock{ #lang typed/racket } But if I type @codeblock{ #lang planet foo/bar } only the word "planet" is underlined, which seems odd ("planet" is not the name of the language; the analog of "racket" should be either "planet foo/bar" or "foo/bar" but not "planet"). Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] using scribble --pdf on Windows
Sorry, should have pointed that out. No, I don't see a log file. There are no output files of any sort when scribble is done. I would have anyway thought scribble was doing all this in some tmp directory somewhere else. Aha, I just found out that there's a scribble --latex option. I ran that and it produced a .tex file, which went through pdflatex without a problem (yes, I used the explicit path to pdflatex printed by DrRacket), and the resulting PDF looks good. So the problem is presumably in the interaction between scribble and pdflatex. Running scribble --pdf in that same directory, however, still produces the same error, reinforcing my belief that scribble is running pdflatex in some temp directory where it's still looking for a non-existent .log. [Incidentally, I found out about --latex from running scribble --help. This claims that the default is --text. I believe this is wrong: the default appears to actually be --html.] Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] using scribble --pdf on Windows
Yes. That's why I ran scribble --pdf afterwards in that directory (in the hope it'd pick up that log file, but it didn't, ergo my belief it's running somewhere else). On Sun, Sep 25, 2011 at 2:49 PM, Robby Findler wrote: > When you run pdflatex yourself, do you get a .log file? > > Robby > > On Sun, Sep 25, 2011 at 1:46 PM, Shriram Krishnamurthi > wrote: >> Sorry, should have pointed that out. No, I don't see a log file. >> There are no output files of any sort when scribble is done. I would >> have anyway thought scribble was doing all this in some tmp directory >> somewhere else. >> >> Aha, I just found out that there's a scribble --latex option. I ran >> that and it produced a .tex file, which went through pdflatex without >> a problem (yes, I used the explicit path to pdflatex printed by >> DrRacket), and the resulting PDF looks good. So the problem is >> presumably in the interaction between scribble and pdflatex. >> >> Running scribble --pdf in that same directory, however, still produces >> the same error, reinforcing my belief that scribble is running >> pdflatex in some temp directory where it's still looking for a >> non-existent .log. >> >> [Incidentally, I found out about --latex from running scribble --help. >> This claims that the default is --text. I believe this is wrong: the >> default appears to actually be --html.] >> >> Shriram >> > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] using scribble --pdf on Windows
No problem, thanks for trying. For now I anyway intended to publish only HTML output. What I immediately wanted was to periodically test to make sure the eventual PDF will look okay, and the two-step --latex option is good enough for that. If whoever maintains Scribble/Windows would like to work with me to debug this, do get in touch and I'm happy to try things you suggest. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] red underline of language name
Thanks, though I'm not sure that was my main point. Though I now see that "planet" really is considered a whole language in its own right, so I guess this red underlining is inevitable by the semantics. Incidentally, for those who find this thread later, there's another option you will may useful after you employ Danny's advice: --redirect-main http://docs.racket-lang.org/ This makes the documentation point to the Racket docs site rather than to a path on your location machine (which are not paths you usually want to publish to the world). Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] scribble/text language
Does the scribble/text language work in 5.1.3? Here's the first example in the docs: #lang scribble/text Programming languages should be designed not by piling feature on top of feature, but blah blah blah. ventoux ~/Desktop/r/sk/gradelang> scribble try2.scrbl dynamic-require: name is not provided: 'doc by module: # === context === C:\Program Files (x86)\Racket\5.1.3\collects\racket\private\map.rkt:18:11: map C:\Program Files (x86)\Racket\5.1.3\collects\scribble\run.rkt: [running body] [Same if I run scribble --text .] _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] scribble/text language
Right. Also, I like how the @syntax document very simply states, up top, "It might be easiest to do ... to run the examples in this section". A similar sentence at the top of this documentation would make a big difference. (It's not obvious that some #lang scribble/... things can be run through scribble but others must be run through racket.) Shriram On Mon, Sep 26, 2011 at 8:25 AM, Matthew Flatt wrote: > At Sun, 25 Sep 2011 21:35:08 -0400, Eli Barzilay wrote: >> 50 minutes ago, Shriram Krishnamurthi wrote: >> > Does the scribble/text language work in 5.1.3? Here's the first >> > example in the docs: >> > >> > #lang scribble/text >> > Programming languages should >> > be designed not by piling >> > feature on top of feature, but >> > blah blah blah. >> > >> > ventoux ~/Desktop/r/sk/gradelang> scribble try2.scrbl >> > [...] >> >> Run it with just `racket'. (The `scribble' command line tool is for >> compiling documentation, which is really unrelated to >> `scribble/text'.) > > Can you fix the docs to explain that? One observation to add to the > introduction might be that `scribble --text' produces a text version > for a Scribble document, while `scribble/text' is for a different task. > > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Academic journals publishing Scheme/Lisp related research
TOPLAS Journal of Functional Programming are both excellent choices. There are also other qualified venues such as HOSC. Shriram -- Pardon terseness and mistakes -- sent from phone. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] wrapped TR functions given new name?
I have two different files that provide a function called "isort". One comes from untyped Racket and the other from typed/racket. I am importing them thus: (require [rename-in "untyped-sort-server.rkt" (isort u:isort)]) (require [rename-in "typed-sort-server.rkt" (isort t:isort)]) when I invoke t:isort on a badly typed argument, the error shows as > (t:isort "xyz") . . isort2: contract violation, expected , given: "xyz" ... There is no function called "isort2" in any of the source files that I've written. Is it known that Typed Racket does this kind of artificial renaming, or do I have to work harder to track down why this might be happening? (And if this is known, why does it do this?) Thanks, Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Poll: Does anybody besides Doug use 'plot'?
If you mean this library -- http://docs.racket-lang.org/plot/ -- I do use it in Scribble documents. (And it's just amazing that with two lines of code I can have graphs in my HTML and PDF -- amazing.) I would be able to easily swap it out for something else, though. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] typo in signatures?
check-within http://docs.racket-lang.org/test-engine/index.html#(def._((lib._test-engine/racket-tests..rkt)._check-within)) On Tue, Oct 4, 2011 at 1:48 PM, Hendrik Boom wrote: > On Tue, Oct 04, 2011 at 12:50:36PM -0400, Matthias Felleisen wrote: >> >> For testing, you want to use check-within because check-expects fails. >> >> For real programming, you actually want to use inequality comparisons, >> so that they see how to program with Doubles elsewhere. >> >> For teaching abstraction, you may ask why repeat all these (<= n x n+epsilon) >> everywhere. Oh, let's write inexact=? > > Not sure what inexact=? does. What's needed is something like a > three-argument function that tests |x-y| < epsilon. Epsilon should > not be implicit. > > This can generalise to inexact points in any metric space, and the > like. > > -- hendrik > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Learning Scheme and Racket
> Some of the other commenters in that thread point out a few big things > I missed, like Scribble. Even more than Scribble is the fact that Racket enables Scribble to be constructed in and then integrated into the language. The phrase "a much, much more expressive macro system" is in your reddit list but I think does not capture this flavor (but what can?). Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Poll: Does anybody besides Doug use 'plot'?
How about a synonym instead? I propose "Scheme". <-; On Tue, Oct 4, 2011 at 8:09 AM, David Van Horn wrote: > On 10/1/11 2:51 PM, Neil Toronto wrote: >> >> You know what would convince me the most? Find me a great name for the >> new library that contains the word "plot". It should be clever and sound >> official. > > http://www.morewords.com/contains/plot/ > > David > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] check-fact would be nice...
I admire the consistency of this position - I really do - but we also have check-error. -- Pardon terseness and mistakes -- sent from phone. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Sounds in Universe?
John, have you run your audio stuff w/ world? How hard would that be? On Wed, Oct 19, 2011 at 3:14 PM, Matthias Felleisen wrote: > > No. -- Matthias > > > > On Oct 19, 2011, at 7:59 AM, Yaron Minsky wrote: > >> Is there any support for playing sounds within the Universe teachpack? >> >> y >> _ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users > > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] impersonators/chaperones for lists
I'm missing why there are impersonators and chaperones for various datatypes but not for lists. There's surely a good reason why, but I am having trouble reconstructing what it might be. Anyone? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] impersonators/chaperones for lists
Thanks to you and Sam -- I had wondered if the run-time system wasn't partly driving this, and certainly chaperones on immutable data don't make as much sense. But I don't see them on mutable lists either _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] match in Advanced Student?
I found this confusing when I first encountered it -- the patterns are at the TOP of the page (but not linked from the match docs). Scroll to the top and look for "pattern" in the BNF. On Mon, Oct 31, 2011 at 3:16 PM, Jay McCarthy wrote: > http://docs.racket-lang.org/htdp-langs/advanced.html > > On Mon, Oct 31, 2011 at 1:00 PM, Prabhakar Ragde wrote: >> Is there a written description (suitable for students) of which patterns are >> legal for `match' in Advanced Student, or do I have to dig into the >> implementation and then write one myself? Thanks. --PR >> _ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://faculty.cs.byu.edu/~jay > > "The glory of God is Intelligence" - D&C 93 > > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] scribble --pdf, skull.sty, and stabular.sty
+1 on Windows for skull! _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] the full glory of drracket
You're missing the PLaneT: Installing ... line! _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] profiling
Here's a program: #lang racket (define (even? n) (if (zero? n) true (odd? (sub1 n (define (odd? n) (if (zero? n) false (even? (sub1 n Go to Language | Choose Language, click on Show Details, and at the top-right, select "Debugging and profiling". Now run the program and in the interactions window, run > (even? 25) Go to View | Show Profile. At the bottom of your screen will be the profiling information, showing 13 calls each to even? and odd?. If you run > (even? 25) again in the interactions window, the profile doesn't appear to change. But click on Update Profile (bottom-left) and it'll now show 26 calls each. >From there, mess around! Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
[racket] article about Racket
http://queue.acm.org/detail.cfm?id=2068896 If you participate in a social media site, you may want to post or upvote it (it's already on Hacker News). _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] article about Racket
> so the tools > might let anybody do a new language, but the ability to use those > tools seems to me to be a whole 'nother kettle of fish? Obviously, a tool can be used to produce both good and bad artifacts. But the better the tool, the easier time the toolsmith has with the basics, so the more energy they have left to put into making their product better. With bad tools you're doomed from the start. That's certainly been my experience with #lang in Racket, which is what this article is about. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] article about Racket
Why don't you spend a little time writing down your thoughts, and then post them. Maybe there are things that you're just missing that are already in there. Or perhaps you find what you want but the path to getting there is unintuitive, and seeing the feedback will help improve the user experience. Or maybe some things you want aren't there *for a reason*. Right now everything you've written is simply too vague (and, if you don't mind my saying, a bit too inflammatory) to act on. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] DrRacket needs work
On Nov 13, 2011, at 2:06 PM, Raoul Duke wrote: > > apparently i can't higlight a sub-section of code and "run" just that. When you do this in Eclipse, what exact steps do you follow? And what does Eclipse do in response? Can you show an example? Thanks, Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] DrRacket needs work
> i do it in emacs usually if we are talking about being able to > evaluate chunks. But Emacs is not an IDE. You began by complaining that DrRacket is not more like other traditional IDEs, and making platform-specific complaints. Is there ANY sense in which Emacs is more platform-specific than DrRacket? (I use Emacs all the time, everywhere; I'm typing this in Emacs on Windows 7. But virtually nothing about Emacs's look is "native".) In short, you're expecting that DrRacket's functionality is going to include a traditional IDE AND Emacs? Is that a reasonable demand? And even if it is reasonable, is it a *consistent* one? Emacs lets you perform all sorts of evaluation tricks but without any promise of program integrity. IDEs, in contrast, have the ability to track the connection between program and evaluation, and hence try to provide some kind of coherence about what you're seeing in the output. DrRacket is in the latter category. Here is a useful little puzzle. I strongly urge you to do this before you go forward in this thread. It involves writing only a very small program, and it is an enlightening experience. Let's call this program v.1 (for version 1). Evaluate it. Now change one of the definitions. Let's call the resulting program v.2. But re-evaluate just that changed definition, not the whole program. Now evaluate an expression E that makes sense in both v.1 and v.2 (ie, refers to the same variables, etc). However, E must have the property that the answer it produces now is different from the answer it would have produced if run against v.1 AND different from the answer it would have produced if run against v.2. That is, the answer that you DO get cannot have originated from either version of the program. At that point you will fully understand Bloch's post and why DrRacket does not do what you seem to want it to do and why DrRacket's position is an eminently sensible one. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] DrRacket needs work
> having said that, "eminently sensible" is in the eye of the beholder. > after all, racket didn't have static type checking for most of its > life, no? i am not saying it is or is not eminent in my own view, i am > pointing out that it is pretty subjective so you can't actually call > it "eminently sensible" since to some people it might actually be > eminently a pain in the ass. This is a pretty poor example to illustrate your point, because Racket still does not have static type checking. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] DrRacket needs work
Right. A Racket Declaration of Independence. (-: _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Sending a method as a symbol
Right. In other words, Racket would become a true scripting language. <-; On Tue, Nov 15, 2011 at 3:14 PM, Grant Rettke wrote: > On Mon, Nov 14, 2011 at 8:32 AM, Matthew Flatt wrote: >> At Sun, 13 Nov 2011 21:00:55 +, "nicolas.o...@gmail.com" wrote: >>> Is there a function to send to a class with a dynamic symbol instead of a >>> static one? >>> >>> As in (send 'method-name) >> >> I'll look into this more, but you can write >> >> (send-generic o (make-generic (object-interface o) 'method-name) arg ...) >> >> which suggests that there really should be a variant of `send' that >> works with symbolic method names. > > That is like eval but for talking to objects? > > _ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Why internal definitions?
> Your question suggests that you come from a teaching language > background where we introduce only local definitions. In ISL > and ISL+lambda, the use of local makes it easier to move global > transformations into a local scope and vice versa. Most importantly, > these movement preserve the exact semantics of the definitions, > including errors. Well, internal define could have done this just as well. It is because of the historic Scheme legacy that internal define meant something else, so it was necessary to invent local. But given where we are now, is it fair to say that the use of local make_s_ is easier, rather than _made_? Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Units/measures library
DSSSL (-: (Since I believe Bigloo and/or Gambit implemented DSSSL, lurking in their implementations is code that does this...) _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] Racket documentation for web development is just awful!
Hi R. Noob, > Do the URLs of pages that use continuation > mechanism have to look ugly and cryptic? Yes they do. The URLs are ugly *because* they are cryptic. They are cryptic because it is a route to system security. If they were pretty, people could guess them, and that would adversely affect security in a huge way. Incidentally, this is something we stressed from the very beginning (~late 2000). It meant that certain kinds of Web attacks over which people and Web sites spent a great deal of time (such as CSRF attacks) could simply never occur for systems built atop the PLT Web server. This idea is also incorporated into Google's Belay project: https://sites.google.com/site/belayresearchproject/ If you look at the list of features they state, essentially every single one of these maps onto "ugly and cryptic" URLs. Shriram _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Re: [racket] formlets with radio button & checkbox example?
Let's just agree to ignore the troll, please. Racket Users list: http://lists.racket-lang.org/users
Re: [racket] Engineering Tradeoffs of ANF transforms and the Stateless Server
On Fri, Dec 30, 2011 at 2:54 PM, Noel Welsh wrote: > On Tue, Dec 27, 2011 at 9:26 PM, Galler wrote: >> I note that no one has discussed throwing a significant amount of physical >> memory at the problem. >> >> Empirically, is that because garbage-collection of a large heap creates its >> own performance problems? > > Yes, GC pauses get annoying when the heap gets large. This can lead to > timeouts on the client side. In my experience, GC pauses were less of an issue than paging. I could literally hear the system paging when it hit certain continuation load thresholds. It may be the GC was causing some of this paging to happen (especially since, in those days, the GC was not very sophisticated and may have been touching pages it should have left alone). But as Jay has already said, even if you have a sophisticated GC, you literally cannot collect very much, so you're going to run into the distinction between physical and virtual memory sooner or later. If you *know* an old continuation is never going to be used again, you can use something like send/finish to dispose of it. But you don't, and when someone does use it, a whole bunch of old memory has to get sucked in and a bunch of warm data sucked out. [One of the things that the generation raised on SSDs will miss out on is the visceral auditory feedback of a disk at work.] Continue moved off the (then) PLT Scheme language because there were no good solutions to these problems at that time. It is now a heavily Ajax application, which means the load on the back-end is (I'm guessing and intuiting) far less than it used to be. The server side code is now relatively dumb (and intentionally so), and almost all the interesting action happens on the client. Shriram Racket Users list: http://lists.racket-lang.org/users
Re: [racket] Engineering Tradeoffs of ANF transforms and the Stateless Server
That's a fine position in theory, but I doubt it works well in practice even today. When Jay talks about 3-4 GB, he doesn't mean over the course of a conference -- that could sometimes add up in just a few hours. No amount of cheap RAM is going to combat that. But, as I said, in an Ajax world there is much less need for the rapid accumulation of continuations. Shriram On Sat, Dec 31, 2011 at 4:03 PM, Neil Van Dyke wrote: > Regarding paging... The only three situations in which I consider paging > acceptable nowadays on workstations and servers, when a handful of dollars > buys you a few GB RAM: > > 1. For resilience in exceptional/emergency situations, when the alternative > would be an OOM kill or a crash. > > 2. When an application with massive memory requirements was designed/tuned > specifically to work well with OS's virtual memory behavior. > > 3. Cloud and shared-hosting servers that don't care if performance blows. > > None of my personal machines even have swap partitions, and I don't recall > using even half of my RAM. In this screenshot of lower-right corner of my > screen, it tells me I'm using 16% of 3GB RAM on this workstation that's > running Linux, X, XMonad, PostgreSQL server, Apache, and several different > Racket SCGI servers, in addition to my bloated email client: > http://i.imgur.com/fCBBR.png > > -- > http://www.neilvandyke.org/ > > > > Racket Users list: > http://lists.racket-lang.org/users Racket Users list: http://lists.racket-lang.org/users
[racket] feeding trolls
Hi all, We have until now never barred anyone from this mailing list. We like to keep it that way. Eli Barzilay and I talk about such issues periodically, and have been doing so a LOT lately. Trolls are obviously problematic. We're starting to get unsubscribe messages, which does not help -- the goal of having this list is to build a community, not to break it down. So, we're being forced to confront our principles. I'd still like to stick to our principles. That requires your cooperation. I'm going to ask, one last time, that people NOT FEED TROLLS. Our egos are not too fragile; you don't need to come to our defense. We appreciate the shows of support, but that just leads to building out another round of the spiral. Shriram Racket Users list: http://lists.racket-lang.org/users
Re: [racket] The value of a language
The Scribble language is a great instance of this, though unfortunately there isn't yet really an easily accessible document that lays out the argument crisply for a lay audience. But if you can persist a little, try the Scribble ICFP paper. Racket Users list: http://lists.racket-lang.org/users
Re: [racket] Congratulations to Shriram: Milner Young Researcher Award
Thank you all for your kind words, both public and private. You know the line about standing on shoulders, but it turns out that if the shoulders you stand on are sufficiently tall, mere crouching is sufficient. Those shoulders belong not only to Matthias but also especially to Robby Findler, Cormac Flanagan, and Matthew Flatt, each of whom is smarter than me and whom I continue to look up to. And (rest PLT), notably John Clements and Eli Barzilay, has also kept me on my toes. At Brown I've been fortunate to have outstanding PhD students -- Paul Graunke, Greg Cooper, Jay McCarthy, Arjun Guha, Joe Politz -- as well as several undergrads, post-docs, and collaborators (Kathi Fisler and Dan Dougherty) who've similarly constantly been several steps ahead of me and been kind enough to bring me along. Shriram Racket Users list: http://lists.racket-lang.org/users
[racket] on-line programming languages course
We are making freely available our upper-level programming languages course. People anywhere are welcome to participate in this on-line version. All the details are here: http://www.cs.brown.edu/courses/cs173/2012/OnLine/ Please feel free to disseminate this information. If you have questions, please post them here: https://plus.google.com/117185293319274359863/posts/9rfginQ3w82 I look forward to seeing you in class! Shriram Krishnamurthi, Instructor Joe Gibbs Politz, Associate Instructor Racket Users list: http://lists.racket-lang.org/users
[racket] scribble/lp issues
I'm trying to start using scribble/lp and ran into some issues. 1. When I switch a buffer from scribble/base to scribble/lp, if I have no chunks I get an error. Why is this? It certainly isn't needed for typesetting; for assembling code during execution, when there are no chunk's why isn't it equivalent to require'ing an empty file? 2. There is an lp-include but this is like include, not include-section. This makes it difficult to use in a larger document. I am currently creating an empty shadow file like this: #lang scribble/base @(require scribble/lp-include) @lp-include["first-desugar.scrbl"] and @include-section'ing that. (But hey, at least "it works".) 3. When I switch to scribble/lp, all my non-chunk codeblocks seem to lose their color formatting! The exact same @codeblock{...} that is nice and colored in scribble/base now looks more like @verbatim{...} in scribble/lp; only the code associated with @chunk[...]s is colored. Is there a reason for (1), a better way to do (2), and a way around (3)? The third is the closest to a show-stopper. Thanks! Shriram Racket Users list: http://lists.racket-lang.org/users
[racket] scribbling a stand-alone scribble/lp file
It also appears that one cannot scribble a stand-alone scribble/lp file: it produces dynamic-require: name is not provided name: 'doc ... (This, for instance, is scribbling the very example in http://docs.racket-lang.org/scribble/lp.html .) But scribbling the wrapper seems to work fine. If true this might be useful to mention in the documentation, because it's a bit of an obstacle to getting started with the LP system (the example there *looks* like a complete document that one ought to be able to Scribble!). Shriram Racket Users list: http://lists.racket-lang.org/users
Re: [racket] [plt-edu-talk] Does a Scheme procedure "return" a value?
The function phone-directory consumes a name, then produces/computes a phone number. On Sat, Sep 8, 2012 at 11:26 AM, Richard Cleis wrote: > I am writing documentation. What are acceptable words for the following > brackets? > > The function f [what verbs are ok?] a name, then [what about here?] a phone > number. > > rac > > > > On Sep 8, 2012, at 9:07 AM, Joe Marshall wrote: > > A Scheme procedure might return a value, or it might delegate to another > procedure (via tail recursion). This is a key point: languages without tail > recursion cannot delegate to another procedure. They can do a limited > simulation of delegation by chaining the returns, but this adds an O(n) > space overhead to the computation and consumes stack space, which is a > finite resource (hence the limit). > > > Racket Users list: > http://lists.racket-lang.org/users > > > > > Racket Users list: > http://lists.racket-lang.org/users > Racket Users list: http://lists.racket-lang.org/users
Re: [racket] [plt-edu-talk] Does a Scheme procedure "return" a value?
I concur w/ Joe that there's something to be said for using "returns" since you're presumably writing documentation that you want non-Racketeer to read and immediately understand -- your goal here (presumably) isn't to be pedantic. This is in contrast to a programming or programming languages course, where this bit of pedantry is sort of the point. Shriram On Sat, Sep 8, 2012 at 11:33 AM, Joe Marshall wrote: > > On Sep 8, 2012 8:19 AM, "Richard Cleis" wrote: >> >> I am writing documentation. What are acceptable words for the following >> brackets? >> >> The function f [what verbs are ok?] > > Takes, accepts, > >> a name, then [what about here?] a phone number. > > Computes, evaluates to, reduces to, > (Or even "returns", if you don't mind if Ellen and I cringe. We'll know what > you mean.) > >> >> rac >> >> >> >> On Sep 8, 2012, at 9:07 AM, Joe Marshall wrote: >> >>> A Scheme procedure might return a value, or it might delegate to another >>> procedure (via tail recursion). This is a key point: languages without tail >>> recursion cannot delegate to another procedure. They can do a limited >>> simulation of delegation by chaining the returns, but this adds an O(n) >>> space overhead to the computation and consumes stack space, which is a >>> finite resource (hence the limit). >>> >>> >>> Racket Users list: >>> http://lists.racket-lang.org/users >> >> > > > > Racket Users list: > http://lists.racket-lang.org/users > Racket Users list: http://lists.racket-lang.org/users