Re: [racket] racket runs very slowly

2015-01-17 Thread Carl Eastlund
Yes, it's loading ".rkt" sources, I now see that I pulled a version with a build error so lots of things failed to build. I'll build from a version that actually works. :) Carl Eastlund On Fri, Jan 16, 2015 at 12:33 PM, Matthew Flatt wrote: > It sounds like a bytecode

[racket] racket runs very slowly

2015-01-15 Thread Carl Eastlund
I just updated my Racket clone and rebuilt it for the first time in quite a while. Now every command I run is extremely slow. 'raco --help' takes 15 seconds. 'racket -e "(void)"' takes 20 seconds. Does anyone know what might be going on? Carl Eastlund __

Re: [racket] Little Schemer, lat?

2015-01-03 Thread Carl Eastlund
Because all-true and all-false are both all-something, they are both written (and), not (or). If you want something corresponding to (or), you need at-least-one-true or at-least-one-false. In general, all-true is the negation of at-least-one-false, and all-false is the negation of at-least-one-tr

Re: [racket] Determining if already defined?

2014-11-14 Thread Carl Eastlund
If you install the package "mischief", you can use define-if-unbound and similar forms. http://pkg-build.racket-lang.org/doc/mischief@mischief/Definitions_and_Binding_Forms.html Carl Eastlund On Fri, Nov 14, 2014 at 5:27 PM, Kevin Forchione wrote: > Hi guys, > Is there a

Re: [racket] Mischief causing mischief

2014-10-03 Thread Carl Eastlund
g update mischief" you should get a version that does not have these issues. If that doesn't fix it, let me know. And thanks for the report! Carl Eastlund On Fri, Oct 3, 2014 at 3:13 PM, Byron Davies wrote: > I’m trying to use the mischief #lang. I did raco pkg install mischief, &g

Re: [racket] is there any way to check whether two syntax objects have the same ... ?

2014-08-17 Thread Carl Eastlund
Comparing lexical context is a very involved process. Remember that every syntax object potentially carries context for an unbounded number of symbol names at an unbounded number of phases, since context information can be transferred freely. Comparing all of them for equivalence would be quite e

Re: [racket] Sometimes (syntax-e #) produces a non-list pair

2014-04-16 Thread Carl Eastlund
ally put a syntax node at each cons. Then proc-with-stx substitutes that for expr, and you get [essentially] #'(lambda . ((x) . (#f . (. Basically, you can't rely on where syntax-e will split up a list into syntax objects unless you constructed it yourself. If you want predictable resu

[racket] Dracula web page has moved

2014-03-30 Thread Carl Eastlund
The web page for Dracula, the DrRacket front-end to the ACL2 theorem prover, has moved; it is now at: http://dracula-lang.github.io The old page now contains a link to the new one. Carl Eastlund Racket Users list: http://lists.racket-lang.org/users

Re: [racket] first vs car ; last vs cdr ; empty? vs null?

2014-03-08 Thread Carl Eastlund
o pay for inspecting those arguments until needed. Carl Eastlund On Sat, Mar 8, 2014 at 12:47 PM, Matthias Felleisen wrote: > > You want cons (the frequent action) to take constant time: allocate > pointer, set two fields. > > > On Mar 8, 2014, at 12:33 PM, David T. Pierson wrot

Re: [racket] first vs car ; last vs cdr ; empty? vs null?

2014-03-07 Thread Carl Eastlund
The first/rest operations do not use a memoization table. They test using the list? primitive, which is built in and actually has a couple of tag bits reserved on every cons object for memoizing its results. So the operation really is quite fast. Carl Eastlund On Fri, Mar 7, 2014 at 4:40 PM

Re: [racket] FW: weakly held symbols?

2014-01-28 Thread Carl Eastlund
wer is clear. > Jos > > -- > *From:* Carl Eastlund [mailto:carl.eastl...@gmail.com] > *Sent:* martes, 28 de enero de 2014 18:13 > *To:* Jos Koot > *Cc:* Racket Users > *Subject:* RE: [racket] FW: weakly held symbols? > > Racket will generally

Re: [racket] FW: weakly held symbols?

2014-01-28 Thread Carl Eastlund
t line <--- 1 and uncommenting line > <--- 2, I would expect the same results, but I find: > > (6 0) ; ok > hash with 6 entries ; ok > (6 0) ; a surptrise for me > hash with 6 entries ; a surprise for me > > This is the cause of my confusion. Surely I am misinterpreting th

Re: [racket] Is there any limitation, the numbers of arguments in Racket?

2014-01-27 Thread Carl Eastlund
Be careful reading your error messages. The first one says "result arity mismatch", the second one says "repl: arity mismatch". Only the second one is about the arguments you passed to the function called "repl". The first one must be about something else that w

Re: [racket] FW: weakly held symbols?

2014-01-27 Thread Carl Eastlund
ld be either by tracking memory use statistics, or by comparing the results of something like eq-hash-code, neither of which should be surprising to find out behaves impurely. Carl Eastlund On Mon, Jan 27, 2014 at 5:53 PM, Jos Koot wrote: > It appears that my previous email was not sent com

Re: [racket] selectively local-expand sub-expressions

2014-01-26 Thread Carl Eastlund
, you won't run into this problem. Carl Eastlund On Sun, Jan 26, 2014 at 6:34 PM, Carl Eastlund wrote: > You can do it like this: > > https://gist.github.com/carl-eastlund/8640925 > > Basically, you quasiquote the result of the expansion, and then you > unquote variables wh

Re: [racket] selectively local-expand sub-expressions

2014-01-26 Thread Carl Eastlund
You can do it like this: https://gist.github.com/carl-eastlund/8640925 Basically, you quasiquote the result of the expansion, and then you unquote variables when you hit them so that they are evaluated normally. Anything with an unbound variable will fail at expansion time. Carl Eastlund

Re: [racket] selectively local-expand sub-expressions

2014-01-26 Thread Carl Eastlund
Scott -- I don't understand exactly what you're asking, at least not based on the example you wrote. You defined x and y, but the error is about z. Is this just a typo? Or are you expecting a value for z to come from somewhere? Carl Eastlund On Sun, Jan 26, 2014 at 1:01 PM, Scott

Re: [racket] selectively local-expand sub-expressions

2014-01-25 Thread Carl Eastlund
t;pred?", for example. I don't know if that's a concern, but again, it can't hurt. Anyway, you can find what I wrote here: https://gist.github.com/carl-eastlund/8626893 Carl Eastlund On Fri, Jan 24, 2014 at 1:30 PM, Scott Klarenbach wrote: > Just an update, I was able to ma

Re: [racket] `immutable?` for `struct`s?

2014-01-25 Thread Carl Eastlund
icated. Most likely, #:transparent is the way to go. Carl Eastlund On Sat, Jan 25, 2014 at 6:25 PM, Greg Hendershott wrote: > > skipped? = #t can only arise if some struct type in the hierarchy is > opaque, > > which would mean struct? returns #f. If you only care about types that > &g

Re: [racket] `immutable?` for `struct`s?

2014-01-25 Thread Carl Eastlund
skipped? = #t can only arise if some struct type in the hierarchy is opaque, which would mean struct? returns #f. If you only care about types that satisfy struct?, you should be able to safely ignore skipped?, if I understand it correctly. Carl Eastlund On Sat, Jan 25, 2014 at 6:07 PM, Greg

Re: [racket] `immutable?` for `struct`s?

2014-01-25 Thread Carl Eastlund
is a bit odd, mostly since it has been growing incrementally over time. Carl Eastlund On Sat, Jan 25, 2014 at 4:41 PM, Greg Hendershott wrote: > I understand that, as its documentation clearly says, `immutable?` is > not implemented for `struct`s. (In the sense that structs aren't

Re: [racket] selectively local-expand sub-expressions

2014-01-23 Thread Carl Eastlund
ay down, or we delay the effect somehow. For instance, you might wrap the expression with let-syntax to rebind the names pred-a? and pred-b?, shadowing them with macros that do the substitution you want when expansion naturally reaches them. Carl Eastlund On Thu, Jan 23, 2014 at 8:06 P

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded? (Greg Hendershott)

2014-01-20 Thread Carl Eastlund
But the hash table only needs to exist in one place, it doesn't need to be bound in each namespace. Anything that needs to get at metadata for bindings just looks at the hash table directly, not via syntax-local-value of some identifier. Carl Eastlund On Mon, Jan 20, 2014 at 6:49 PM,

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded? (Greg Hendershott)

2014-01-20 Thread Carl Eastlund
p based on the original binding, is reliable. Using an extra binding that _should_ be there in most namespaces, can be broken by contexts you have no control over. Carl Eastlund On Mon, Jan 20, 2014 at 6:31 PM, Scott Klarenbach wrote: > If/when it does matter, instead you could use a hashtabl

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-20 Thread Carl Eastlund
Yes, that's exactly it. Carl Eastlund On Mon, Jan 20, 2014 at 10:13 AM, Alexander D. Knauth wrote: > I'm just curious, is this what you mean? > > #lang racket > > (require rackunit > (for-syntax > syntax/parse)) > > (begin-for-syntax

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Carl Eastlund
-info. You can't make something both a procedure and a symbol, because symbols don't work via struct properties, but you could make it both a procedure and a struct that contains a symbol. Carl Eastlund On Mon, Jan 20, 2014 at 12:21 AM, Scott Klarenbach wrote: > That doesn'

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Carl Eastlund
ferences to posn are transformed into references to the actual procedure value you're seeing as #. Carl Eastlund On Sun, Jan 19, 2014 at 11:57 PM, Scott Klarenbach wrote: > It's not changing it, I'm just trying to figure out the implementation and > understand what I'm

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Carl Eastlund
value that doesn't? Carl Eastlund On Sun, Jan 19, 2014 at 11:27 PM, Scott Klarenbach wrote: > But I don't see how the same binding can be a transformer and also return > something else (like a list, or a checked-struct-info-thing) via > syntax-local-value. > > If I bind my-

Re: [racket] Structs and syntax-local-value ... how is the struct name overloaded?

2014-01-19 Thread Carl Eastlund
hen passed to relevant macros. Carl Eastlund On Sun, Jan 19, 2014 at 11:00 PM, Scott Klarenbach wrote: > How is it that the definition of (struct my-name (x y)) can bind > *my-name*both as a # at runtime and a transformer-binding > *my-name* that at compile time (via syntax-lo

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Carl Eastlund
Ah, good point. If that's a concern then you want to do it your way. My way would depend on rackunit when running the main module. Carl Eastlund On Wed, Jan 8, 2014 at 7:36 PM, Scott Klarenbach wrote: > Would that affect the loading of rackunit during main vs test runs of the >

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Carl Eastlund
#x27;t need the extra (require rackunit) inside the macro template; you'll be able to refer to test-case from rackunit the same way you referred to require and provide from racket. Carl Eastlund On Wed, Jan 8, 2014 at 7:13 PM, Scott Klarenbach wrote: > Sorry, gmail sent before I could pa

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Carl Eastlund
ntext of the module name rackunit. So when things go wrong with macro bindings, the first question is always "_which_ scope is this bound in?" and usually the second is "well, what context does the binding occurrence have?". I hope that helps, these are really murky waters, s

Re: [racket] module+ test... (require rackunit) results in unbound identifier when used in macro

2014-01-08 Thread Carl Eastlund
I do not suggest rebinding the whole body like that; it could be seriously problematic if the user refers to something not viable to the macro definition. What you need to rebind is the name "rackunit" itself passed to require so that it has the context of the macro application. That way the name

Re: [racket] Another Canonical Use of Macros?

2013-11-25 Thread Carl Eastlund
I agree. It doesn't bind in the sense of extending an environment, but it does in the sense of causing a new set of references to be resolved, e.g. x.method_name() for any x that now implements the trait in question. Carl Eastlund On Mon, Nov 25, 2013 at 4:35 PM, Matthias Felleisen

Re: [racket] Confused between strings and symbols

2013-10-27 Thread Carl Eastlund
ol? y) (list? y) ... and so on. I don't know if this answers all your questions, but hopefully being able to explore this stuff yourself will get you a few steps further. Carl Eastlund On Sun, Oct 27, 2013 at 4:23 PM, Bo Gus wrote: > If I evaluate this: > > (list 'this '

Re: [racket] combine-in doesnt combine?

2013-10-08 Thread Carl Eastlund
) > > module: identifier already imported from a different source in: > image? > (rename 2htdp/image image? image?) > (rename lang/htdp-beginner image? image?) > > Racket Users list: > http://lists.racket-lang.org/users > > -- Carl Eastlund __

Re: [racket] syntax-temporaries srfi-53

2013-09-27 Thread Carl Eastlund
e generate-temporaries (or generate-temporary from racket/syntax for just one identifier), even in compiled programs. Carl Eastlund On Fri, Sep 27, 2013 at 1:23 AM, Niitsuma Hirotaka < hirotaka.niits...@gmail.com> wrote: > Also I found > > (define-macro (syntax-gensym k) > (let ((v

Re: [racket] Introduction to syntax-parse

2013-09-26 Thread Carl Eastlund
On Wed, Sep 25, 2013 at 7:59 AM, Sam Tobin-Hochstadt wrote: > On Wed, Sep 25, 2013 at 2:14 AM, Konrad Hinsen > wrote: > > > > > Maybe making the error message more specific like "Did you forget to > (require > > > (for-syntax syntax/parse)) ?" ? Or is it too specific? > > > > It would already h

Re: [racket] Request feedback on a boggle solver

2013-09-24 Thread Carl Eastlund
llest possible example. Write at least one base case test, at least one test for a single step beyond the base case, and at least one test larger than that. That way, when a test goes wrong, you don't just know that the function is broken, you have some idea how and why it is broken. Ca

Re: [racket] RacketCon / hackathon question

2013-09-23 Thread Carl Eastlund
The hackathon is open for anyone to work on anything. We have suggestions, which may or may not be at your son's speed, but we'll be there to help him find something that's good for him, and the choice will ultimately be up to him. So absolutely, send him along if he'd like to join us! --Carl O

Re: [racket] Request feedback on a boggle solver

2013-09-21 Thread Carl Eastlund
Looking forward to to your followup! Carl Eastlund P.S. copying to the mailing list so everyone's in the loop. On Sat, Sep 21, 2013 at 8:25 PM, Jingjing Duan wrote: > Hi Carl, > > Thanks for your great feedback. Let me try to rewrite the code, this time > by following the

Re: [racket] macro not getting expanded as argument to class/c

2013-09-21 Thread Carl Eastlund
ary. Just do the work of make-button-contracts in the macro that constructs the call to class/c*, and there won't be any nested-expansion to do. Adding a new kind of macro expander is probably overkill for the problem at hand. Carl Eastlund On Sat, Sep 21, 2013 at 2:15 PM, Christopher wrote:

Re: [racket] Request feedback on a boggle solver

2013-09-21 Thread Carl Eastlund
On Sat, Sep 21, 2013 at 12:09 PM, Jingjing Duan wrote: > Hi, > > I've been reading HTDP and I'm about half way through. To apply what I've > learned in the book to a bigger exercise, I decided to write a boggle > solver. > > You can find the code here: > https://github.com/jduan/boggle_scheme/blob

Re: [racket] Syntax-e & syntax->list

2013-09-09 Thread Carl Eastlund
pends on how the syntax was constructed. The syntax->list function, however, guarantees you won't hit a syntax object somewhere along the way. Carl Eastlund On Mon, Sep 9, 2013 at 3:53 PM, Roman Klochkov wrote: > In help about syntax->list: In other words, syntax pairs in

Re: [racket] Question on error message

2013-09-06 Thread Carl Eastlund
t checkout. We would also really appreciate it if you could report this bug using "Submit Bug Report..." in the Help menu of DrRacket. Thanks very much, sorry for the bug! Carl Eastlund On Fri, Sep 6, 2013 at 9:22 AM, Alvin Schatte wrote: > Hello Carl, > > I found a loc

Re: [racket] Question on error message

2013-09-04 Thread Carl Eastlund
and I have to install "wmfarr/simple-matrix:1:1", which is doable but inconvenient. Thanks for the question and followup, and I'm happy to help if you can post a complete example. Carl Eastlund On Wed, Sep 4, 2013 at 10:22 PM, Alvin Schatte wrote: > Hello Carl, > Thank y

Re: [racket] Question on error message

2013-09-04 Thread Carl Eastlund
ouldn't be duplicate definitions, and if there are, it's likely not your fault. Can you share the code that causes this error message? If so, someone may be able to diagnose the error. Otherwise, with just the error message, we don't have much to go on. Carl Eastlund On Wed, Sep 4, 2

Re: [racket] Macro design question: best way to interpret an expression multiple ways

2013-09-04 Thread Carl Eastlund
problem. Sometimes it's okay to have a single, limited source of macro duplication. Carl Eastlund On Wed, Sep 4, 2013 at 5:31 PM, Neil Toronto wrote: > I have two libraries of combinators meant to be used as targets for a > language semantics. I'm implementing the semantics using

Re: [racket] as-patterns?

2013-09-02 Thread Carl Eastlund
Eric, use an "and" pattern. (and elem (cons a b)) Carl Eastlund On Mon, Sep 2, 2013 at 3:24 PM, Eric Tanter wrote: > Hi, > > Is there a way to bind a name to a whole sub-value being matched in > pattern? > > eg. like var@pat in Haskell: > (match l > [(cons

Re: [racket] struct #:methods question

2013-08-28 Thread Carl Eastlund
documentation was clarifying what you'd get if you referred to them. Now, any undefined method is bound as syntax that will raise a compile-time error if you refer to it without binding it, so the #f part is completely invisible to the user. Carl Eastlund On Wed, Aug 28, 2013 at 10:15 AM,

Re: [racket] struct #:methods question

2013-08-28 Thread Carl Eastlund
No, you don't have to do anything. The #f is an internal detail that is no longer exposed to the user, so I should probably remove it from the documentation. Carl Eastlund On Wed, Aug 28, 2013 at 5:14 AM, Tobias Hammer wrote: > Hi, > > from the docs on #:methods argument to s

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

2013-08-24 Thread Carl Eastlund
ing seen functional programming taught both with ML and with the HtDP languages. Carl Eastlund On Sat, Aug 24, 2013 at 4:38 AM, Ben Duan wrote: > Dear All, > > Here’s a beginner's question about How to Design Programs. > > HtDP puts great emphasizes on data, and it force

Re: [racket] for/fold accum val at each step

2013-08-10 Thread Carl Eastlund
new-sum (cons new-average averages ... and it produces: 100 '(25 20 15 10) Carl Eastlund On Sat, Aug 10, 2013 at 6:56 PM, J G Cho wrote: > I think I understand the following example from the documentation: > > (define (example) > (for/fold ([sum 0] > [

Re: [racket] How to make unit signature macros take prefix into account

2013-08-07 Thread Carl Eastlund
rest of us can look at, and perhaps illustrate what incorrect runtime behavior is caused by this problem? That will be more telling than just the textual name from expansion, because identifiers carry a lot of "invisible" data about their bindings. Carl Eastlund On Wed, Aug 7, 2013 at

Re: [racket] Stuttering problems with big-bang

2013-08-07 Thread Carl Eastlund
smoothly. This is on a relatively recent Mac Mini with 16 GB RAM, 4 physical / 8 virtual cores, and little else running at the time. Carl Eastlund On Wed, Aug 7, 2013 at 5:22 PM, Robby Findler wrote: > I just tried this on my mac (a fairly recent machine but not a super-duper > powerhouse)

Re: [racket] define-values/invoke-unit not working when generated by a macro

2013-08-06 Thread Carl Eastlund
be the dog^ interface, if your macro is used somewhere that the interface is not in scope, or is bound to a different name. For instance, it won't work if you import macros.rkt using prefix-in. Carl Eastlund On Tue, Aug 6, 2013 at 6:05 PM, Nick Main wrote: > By the way, I found that

Re: [racket] define-values/invoke-unit not working when generated by a macro

2013-08-06 Thread Carl Eastlund
;s necessary to go that far to work with advanced macros; mostly, writing things with default hygiene as much as possible, and occasionally using syntax-local-introduce for tricky stuff like macros that produce units or require forms, will get you pretty far. Carl Eastlund On Tue, Aug 6, 2013 at 5

Re: [racket] define-values/invoke-unit not working when generated by a macro

2013-08-06 Thread Carl Eastlund
(export #,(syntax-local-introduce #'dog^)) Carl Eastlund On Tue, Aug 6, 2013 at 5:11 PM, Nick Main wrote: > I am attempting to write a macro to clean up the use > of define-values/invoke-unit and finding some confusing behavior. > > My macros module is: > &

Re: [racket] `provide` failed under `#lang racket/load`

2013-08-04 Thread Carl Eastlund
On Sun, Aug 4, 2013 at 4:32 AM, Yi Dai wrote: > > > > On Sun, Aug 4, 2013 at 10:20 AM, Carl Eastlund wrote: > >> Yi, >> >> Most #lang languages implicitly create a module from the contents of the >> file. #lang racket/load, on the other hand, runs the con

Re: [racket] `provide` failed under `#lang racket/load`

2013-08-04 Thread Carl Eastlund
ovide things from. You need to either switch back to #lang racket or remove the provide, depending on what you're trying to accomplish. Carl Eastlund On Sun, Aug 4, 2013 at 4:12 AM, Yi Dai wrote: > Hi, > > > I have the following code in a file named `foo.rkt`: > > ``` >

Re: [racket] Using prefix-out with contract-out together

2013-08-04 Thread Carl Eastlund
I've added your email to the bug report, so you'll be notified of any updates. Carl Eastlund On Sun, Aug 4, 2013 at 3:46 AM, Lawrence Woodman wrote: > On 03/08/13 08:00, Carl Eastlund wrote: > > That sounds like a bug in contract-out and/or prefix-out. There's no >

Re: [racket] Using prefix-out with contract-out together

2013-08-03 Thread Carl Eastlund
That sounds like a bug in contract-out and/or prefix-out. There's no reason they shouldn't work right together. And I can confirm the bug -- the bindings get exported with contracts, but by their original names. I assume that's the behavior you're seeing as well. Carl Eas

Re: [racket] Confusion with circular structs

2013-07-26 Thread Carl Eastlund
ither immutable hash tables, or transparent structs, or both, doesn't properly handle circular values. Carl Eastlund On Fri, Jul 26, 2013 at 5:25 PM, Nicholas Labich wrote: > I'm running into what I find to be surprising behavior with circular > structures (vertices of a simple graph).

Re: [racket] Using future and touch

2013-07-25 Thread Carl Eastlund
ove will suffice for your project. Carl Eastlund On Fri, Jul 26, 2013 at 12:43 AM, Joe Gilray wrote: > Hi Robby, > > Please pardon my ignorance, but is there an easy to use thread library > with Racket? I've used threads in other environments and I don't recall so > ma

Re: [racket] Where to learn advanced programming skills?

2013-07-21 Thread Carl Eastlund
d much more in-depth than just reading a book. A book just tells you what 1-2 authors think about how to program; this list can tell you what dozens of Racketeers think about how best to write your program. Carl Eastlund On Mon, Jul 22, 2013 at 1:34 AM, Ben Duan wrote: > Neil, > > Than

[racket] Use `set!' or not in this [other] scenario?

2013-07-19 Thread Carl Eastlund
ther than the rule. I suggest trying to write your solution functionally first, and see how that goes. Resort to set! only if that fails somehow. Carl Eastlund On Fri, Jul 19, 2013 at 12:58 PM, Antoine Noo wrote: > Hello, > > as an extension of the question of Ben. > > (define (fun

Re: [racket] Use `set!' or not in this scenario?

2013-07-19 Thread Carl Eastlund
, (current-data) will only produce the-data while inside f1. So while it's not purely functional, it's a much more disciplined kind of effect. Carl Eastlund On Fri, Jul 19, 2013 at 12:23 PM, Ben Duan wrote: > Scenario: A piece of data is determined in the first function `f1',

Re: [racket] Roadmap for Racket

2013-07-18 Thread Carl Eastlund
I dunno, it seems like a perfectly fine word, it's printed in grocery stores all the time. Now, "woah", on the other hand, that's not a good word. :-P Carl "Whoa!" Eastlund On Thu, Jul 18, 2013 at 4:31 PM, Robby Findler wrote: > Woah, that's a _not_ a good word! > > > On Thu, Jul 18, 2013 at 1

Re: [racket] Question about string conversion

2013-07-18 Thread Carl Eastlund
p you figure out where things went wrong and why. Thanks for your question, feel free to ask more if you have them. Good luck! Carl Eastlund P.S. I know this isn't a simple "regexp-match* works like this" answer. Your question is actually several questions -- what kind of output doe

Re: [racket] learn racket in 10 minutes

2013-07-15 Thread Carl Eastlund
An easy thing to add instead might be a while loop: (define-syntax-rule (while condition body ...) (let loop () (when condition body ... (loop Carl Eastlund On Mon, Jul 15, 2013 at 6:51 AM, Tobias Hammer wrote: > The unless macro seems a bit unfavorable as a macro w

Re: [racket] Macro + function automation

2013-07-10 Thread Carl Eastlund
Save the effort of optimization until you know where it will do the most good. --Carl > Четверг, 11 июля 2013, 0:26 -04:00 от Carl Eastlund : > > Roman, > > Bear in mind that by expanding (square x) to (square x x), that means if > someone writes > > (square (perform-

Re: [racket] Macro + function automation

2013-07-10 Thread Carl Eastlund
Roman, Bear in mind that by expanding (square x) to (square x x), that means if someone writes (square (perform-expensive-computation)) then you will expand it to: (* (perform-expensive-computation) (perform-expensive-computation)) You have to be careful about duplicating inputs in expande

Re: [racket] define-generics #:defaults

2013-07-10 Thread Carl Eastlund
g with your own wrapper functions. Thanks for the report, Carl Eastlund On Wed, Jul 10, 2013 at 5:03 AM, Bert De Ketelaere wrote: > Helo, > > in the documentation it is mentioned that the syntax for define-generics > #:defaults is the same as for struct #:methods: > > http://docs

Re: [racket] Typed Racket: bug with hasheq

2013-07-08 Thread Carl Eastlund
There is such a predicate, Sam, and has been for some time. Carl Eastlund On Mon, Jul 8, 2013 at 5:12 PM, Sam Tobin-Hochstadt wrote: > Ah, I see what went wrong here. It was trying to pass on handling > hasheq in a certain place, but ended up treating it as a hash. I'll > push

Re: [racket] Problem writing and reading sets

2013-07-05 Thread Carl Eastlund
that introduces significant overhead compared to just read/write. On one hand, you do have to allocate the serialized form of the value; on the other, the output itself is likely to be much shorter than the human-readable version, and you will thus save on i/o costs. Carl Eastlund On Sat, Jul 6,

Re: [racket] Problem writing and reading sets

2013-07-05 Thread Carl Eastlund
Wayne, You cannot read in a set. If you read in the result of print, you get '(set 1 2 3), which is a list beginning with the symbol 'set, not a set. Sets are a derived datatype using structs, not a primitive on recognized by read and write. You can use the functions serialize and deserialize to

Re: [racket] raco pkg down?

2013-06-28 Thread Carl Eastlund
at yet. Thanks for your patience, Cosme and anyone else waiting on the server. Carl Eastlund On Fri, Jun 28, 2013 at 5:51 PM, Carl Eastlund wrote: > Sorry, Cosme, I don't know what's wrong with the server, and I haven't > gotten any response from the few people I've aske

Re: [racket] raco pkg down?

2013-06-28 Thread Carl Eastlund
has been down for over 24 hours without comment, we need to be able to respond to outages more quickly than this. Carl Eastlund On Thu, Jun 27, 2013 at 4:25 PM, Cosme Enmanuel Zamudio Salazar < cos...@gmail.com> wrote: > it looks like https://pkg.racket-lang.org/ is down. i

Re: [racket] How to to make a program that will take a simple racket file, parse it with the reader in a way that I can expand it?

2013-06-14 Thread Carl Eastlund
s needed, but define-runtime-path worked for a quick example. Carl Eastlund On Fri, Jun 14, 2013 at 4:32 PM, Vincent St-Amour wrote: > Ah, right, sorry about that. My previous example works at the REPL, but > not in a module. This should work in both cases: > &

Re: [racket] Style or and/define

2013-06-11 Thread Carl Eastlund
want spurious (void) or (values) or some such to spoil your conditional. Carl Eastlund On Tue, Jun 11, 2013 at 1:21 PM, Laurent wrote: > Interesting, I see your point (not yet sure I adhere to it though). > > Anyway don't you think there is a readability problem with the mentioned

Re: [racket] Test to disambiguate x-expression attributes vs. content?

2013-06-11 Thread Carl Eastlund
Makes it easier to use existing facilities on them, like quote, quasiquote, map, etc. Carl Eastlund On Tue, Jun 11, 2013 at 1:08 PM, Matthew Butterick wrote: > To ask an abstract question: is there a particular reason that > X-expressions are defined in Racket as a special kind of S-expr

Re: [racket] Style or and/define

2013-06-11 Thread Carl Eastlund
aos. I'm all for definitions anywhere they can be clearly seen as not part of the result form. Let's not put them in between arguments whose results matter, please. Carl Eastlund On Tue, Jun 11, 2013 at 12:49 PM, Laurent wrote: > When I see what Robby is forced to write when follo

Re: [racket] set!: eval-ing to lvalues

2013-06-09 Thread Carl Eastlund
y interesting research to implement it in an existing Scheme. I just mean it's not immediately obvious that it's a win/win scenario. Predicting the impact of features like this is difficult, because they're interacting with so much else in the language. Carl Eastlund On Sun, Jun

Re: [racket] set!: eval-ing to lvalues

2013-06-09 Thread Carl Eastlund
ific details. In the meantime, I hope this explanation is helpful. Carl Eastlund On Thu, Jun 6, 2013 at 4:12 PM, Sean Kanaley wrote: > Hello all, > > I was curious why Scheme and now Racket does not inherently support a > generic set!. I found an SRFI > http://srfi.schemers.org

Re: [racket] syntax-parse, macros, and literal-sets

2013-05-30 Thread Carl Eastlund
On Thu, May 30, 2013 at 12:25 PM, Eric Dobson wrote: > Why do literal-sets have to be unhygienic? I expected them to work > like literal lists which you say are hygienic. Also literal-sets are > not documented as being unhygienic, which was the confusing part. > Literal sets are hygienic in the i

Re: [racket] dynamic-require and submod

2013-05-29 Thread Carl Eastlund
e-time using quote-module-path: #lang racket (module m racket (define x 123) (provide x)) (require syntax/location) (define path-to-m (quote-module-path m)) Then at the REPL: > (dynamic-require path-to-m 'x) 123 Carl Eastlund On Wed, May 29, 2013 at 5:19 AM, Tobias Hammer wrote

Re: [racket] Thought about namespaces

2013-05-26 Thread Carl Eastlund
Jos, When you use make-base-empty-namespace, you get a namespace that shares the current instantiation of racket/base and nothing else. When you import racket using namespace-require, the result is a namespace that shares the original racket/base but has a fresh copy of everything else from racke

Re: [racket] typed racket slow?

2013-05-08 Thread Carl Eastlund
On Wed, May 8, 2013 at 7:04 AM, Manfred Lotz wrote: > On Wed, 8 May 2013 06:19:27 -0400 > Carl Eastlund wrote: > > > I'm seeing similar results on my end; I timed by first running "raco > > make" on both files, then timing "racket" on both. I think

Re: [racket] typed racket slow?

2013-05-08 Thread Carl Eastlund
each subsequent computation, so the difference depends on how much "real" work you do after startup. I don't know what causes that startup cost, but hopefully this kind of benchmark will be useful to the Typed Racket maintainers in closing the gap for future versions. So, thanks for th

Re: [racket] A function that creats a single module from multiple modules?

2013-04-21 Thread Carl Eastlund
ntain something closer. You can see the documentation at http://docs.racket-lang.org/raco/demod.html, but it says little more than I already have. Carl Eastlund On Sun, Apr 21, 2013 at 9:18 PM, Don Green wrote: > Is there a Racket function that will create a single module file from > multiple module

Re: [racket] Json pretty-print

2013-04-16 Thread Carl Eastlund
Nick, I've just built pretty-printing for JSON in a Gist you can see here: https://gist.github.com/carl-eastlund/5398440 It's built on top of my own "stylish printing" library, mischief/stylish, that you can install by running: raco pkg install mischief I'll

Re: [racket] fingertree / nested datatype

2013-04-11 Thread Carl Eastlund
I'm confused, Sam. Is the example with the indirect struct less problematic somehow? Or should it be failing? Carl Eastlund -- WARNING! Poorly-typed cell phone email precedes. On Apr 11, 2013 7:23 AM, "Sam Tobin-Hochstadt" wrote: > The reason this doesn't work is tha

Re: [racket] Adding a raco command not working for me

2013-04-09 Thread Carl Eastlund
If you want your tool to be in the submodule named main, your definition of raco-commands should be: (define raco-commands '(("frog" (submod frog main) "run Frog" #f))) Carl Eastlund On Mon, Apr 8, 2013 at 10:37 PM, Greg Hendershott wrote: > Ah. You mean I need

Re: [racket] Misleading label when registering with pkg.racket-lang.org

2013-04-08 Thread Carl Eastlund
Thanks for fixing that, Jay. I went through the same confusion as Tony when I submitted the "mischief" package. Nice to know it's clearer, now. Carl Eastlund On Sat, Apr 6, 2013 at 5:06 PM, Jay McCarthy wrote: > K, I just changed it > > On Sat, Apr 6, 2013 at 3:03 PM

Re: [racket] Package: What to do about an "examples" subdir -- can it be ignored?

2013-04-05 Thread Carl Eastlund
n add them to compile-omit-paths in info.rkt so they don't have to be compiled at installation time for your package. Carl Eastlund On Fri, Apr 5, 2013 at 2:46 PM, Greg Hendershott wrote: > On reflection, 3 seems impossible, since the content of the package is > whatever is in the Git

[racket] Mischief: A Racketeer's Toolkit (new general-purpose "Planet 2" package)

2013-03-31 Thread Carl Eastlund
mischief/memoize, for automatically memoized functions with full support for optional, keyword, and rest arguments Right now the documentation is bare-bones and short on examples, and the test suites are practically non-existent. Suggestions, comments, and critiques are welcome; patches would make you m

Re: [racket] Rounding

2013-03-16 Thread Carl Eastlund
t how that works. Carl Eastlund On Sat, Mar 16, 2013 at 8:32 PM, Eric Dobson wrote: > The docs say that it is round to even, which is the standard for > floating point numbers [1]. You can write your own rounding operator > that rounds .5 up if need be. > > ;; Untested > (define (m

Re: [racket] Type of curry

2013-02-25 Thread Carl Eastlund
n the future, perhaps the TR implementers can broaden the type of curry a bit. Types for this kind of higher-order function are an area of open research for TR, so perhaps things will get better in the future. Carl Eastlund On Sun, Feb 24, 2013 at 5:59 PM, Norman Gray wrote: > > Greetings,

Re: [racket] TR Numeric Tower

2013-02-13 Thread Carl Eastlund
That might not be what he wants either, if he wants anything representable as a flonum to be a flonum. For instance, (S->F "5") is #false by your implementation. It's hard to tell exactly what S->F is supposed to do without more of a specification. Carl Eastlund On Wed,

Re: [racket] TR Numeric Tower

2013-02-13 Thread Carl Eastlund
On Wed, Feb 13, 2013 at 9:49 PM, Ray Racine wrote: > What is the most efficient way to write the following method in TR? > > (: S->F (String -> (Option Float))) > Presumably by writing to the list and having someone else write it. But you've clearly already implemented that method. ;-) --Carl

  1   2   3   >