Re: [racket-users] Scribble: Typeset equations using Latex packages amsmath and amssym

2015-09-23 Thread Alexander D. Knauth
> On Sep 23, 2015, at 8:53 AM, Marc Kaufmann wrote: > #lang racket/base > > (require scribble/base > scribble/core) > > (provide equation*) > > (define (mymath start end . strs) > (make-element (make-style "relax" '(exact-chars)) `(,start ,@strs ,end))) >

[racket-users] Ambiguous binding error, and trying to add generic-interface inheritance

2015-09-23 Thread Alexander D. Knauth
I'm trying to add inheritance to generic interfaces: https://github.com/AlexKnauth/racket/tree/gen-extends But it's in a weird state where it's passing some of the time, (seemingly depending on how exactly I fiddle with it, compile it,

Re: [racket-users] Scribble: line comment swallows paragraph break

2015-09-17 Thread Alexander D. Knauth
I forgot to include the list: > On Sep 17, 2015, at 10:57 AM, Alexander D. Knauth <alexan...@knauth.org> > wrote: > > Is there any reason why > #lang at-exp racket > '@stuff{ > Hello @; John > > World > } > Shouldn't produce > '(stuff "Hello &qu

Re: [racket-users] Macro-generating macros

2015-09-04 Thread Alexander D. Knauth
> On Sep 4, 2015, at 4:26 AM, Konrad Hinsen wrote: > > Brian Mastenbrook writes: > >> It's a capture problem. In the first case, you're just binding the >> name "send" locally and all is well. In the second case, you're >> trying to introduce a binding for "send"

Re: [racket-users] Lost in ellipsis depths

2015-09-02 Thread Alexander D. Knauth
> On Sep 2, 2015, at 7:09 AM, Konrad Hinsen wrote: > > Konrad Hinsen writes: > >> In fact, what I want is do something like map over the ellipsis pattern, >> but I haven't seen any example for doing this. > > Well, map actually works: > > (syntax-parse #'(foo a b

Re: [racket-users] unclear about this `parameterize` behavior

2015-08-30 Thread Alexander D. Knauth
To add to that a little bit, this is what I found: #lang multi-file #file param.rkt #lang racket (provide my-param) (define my-param (make-parameter 'default)) #file param-test.rkt #lang racket (require param.rkt) (define-namespace-anchor a) (parameterize ([current-namespace

Re: [racket-users] Creating a language that extends typed/racket

2015-08-30 Thread Alexander D. Knauth
On Aug 30, 2015, at 6:31 PM, Alexis King lexi.lam...@gmail.com wrote: (Disclaimer: I think this question may have been visited before on this mailing list, but I couldn’t find any resolution, so I’m going to ask again.) Yes. What came out of it was this, which they got to work:

Re: [racket-users] My son's game in Racket

2015-08-24 Thread Alexander D. Knauth
Or something like this, with the rackjure package: (require rackjure/threading 2htdp/image) (~ background-img (place-image image-1 x y) ; the background-img will be inserted as the last argument, because that's what ~ does (place-image image-2 x y) ; the background + image-1 will be

[racket-users] (set-implements? (mutable-set) 'set-add)

2015-08-24 Thread Alexander D. Knauth
It seems to me that (set-implements? (mutable-set) 'set-add) should return #f, and in 6.1.1 (and I think 6.2), that's true. But in the latest snapshots, it produces #t. It seems like it's implemented as an error message instead of not implemented at all, and `set-implements?` can't tell the

Re: [racket-users] (set-implements? (mutable-set) 'set-add)

2015-08-24 Thread Alexander D. Knauth
Was it this commit here? https://github.com/plt/racket/commit/606a94621253391536e9c89c573dc70fd28efbe6 On Aug 24, 2015, at 5:50 PM, Alexander D. Knauth alexan...@knauth.org wrote: It seems to me that (set-implements? (mutable-set) 'set-add) should return #f, and in 6.1.1 (and I think 6.2

Re: [racket-users] macro-generate attribute access?

2015-08-22 Thread Alexander D. Knauth
Does this get you what you want? #lang racket (require (for-syntax syntax/parse racket/syntax)) (define-syntax (define-stuff stx) (syntax-parse stx [(_ attr-name macro-name) #:with c.attr-name (format-id #'c ~a.~a #'c #'attr-name) #'(begin (begin-for-syntax

[racket-users] DrRacket crashing?

2015-08-21 Thread Alexander D. Knauth
I have no idea what's been happening, but in the past half hour or so DrRacket has crashed on me (I think) 6 times. I don't know if this will help but here is what was in the error window that my computer gave me: Process: DrRacket [20469] Path:

Re: [racket-users] macro making a struct with a macro

2015-08-17 Thread Alexander D. Knauth
Are you looking for a macro like this: #lang racket (require syntax/parse/define (for-syntax racket/syntax)) (define-simple-macro (define-struct-fields struct:id (field:id ...) v:expr) #:with s (generate-temporary #'struct) #:with [struct-field ...] (for/list ([field (in-list (syntax-list

Re: [racket-users] Match value of symbol vs. binding to it

2015-08-17 Thread Alexander D. Knauth
On Aug 18, 2015, at 1:18 AM, Brian Adkins lojicdot...@gmail.com wrote: On Tuesday, August 18, 2015 at 1:13:16 AM UTC-4, Alex Knauth wrote: Is == what you're looking for? Or do you want a version of == that uses string=? ? I'm not sure what you're suggesting. I basically want a way to

[racket-users] pkg version exceptions: ranges of versions?

2015-08-16 Thread Alexander D. Knauth
Is there a way to create a version exception for a range of versions, instead of for a single version? -- 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

Re: [racket-users] how to wrap a #lang module for the REPL?

2015-08-15 Thread Alexander D. Knauth
see if I can adapt that solution. On Aug 15, 2015, at 4:31 PM, Alexander D. Knauth alexan...@knauth.org wrote: What kind of funny stuff? By the way, this sounds sort of like this http://www.mail-archive.com/racket-users@googlegroups.com/msg28020.html Solution: http://www.mail

Re: [racket-users] how to wrap a #lang module for the REPL?

2015-08-15 Thread Alexander D. Knauth
What kind of funny stuff? By the way, this sounds sort of like this http://www.mail-archive.com/racket-users@googlegroups.com/msg28020.html Solution: http://www.mail-archive.com/racket-users@googlegroups.com/msg28031.html Although it could be a completely different problem, I don't know. On Aug

Re: [racket-users] how to wrap a #lang module for the REPL?

2015-08-15 Thread Alexander D. Knauth
)) (require 'sub-id) (provide (all-from-out 'sub-id)) body ...))]))) On Sat, Aug 15, 2015 at 9:56 PM, Alexander D. Knauth alexan...@knauth.org wrote: On Aug 15, 2015, at 11:53 PM, Alexander D. Knauth alexan...@knauth.org wrote: Does this work? (define

Re: [racket-users] how to wrap a #lang module for the REPL?

2015-08-15 Thread Alexander D. Knauth
On Aug 15, 2015, at 11:53 PM, Alexander D. Knauth alexan...@knauth.org wrote: Does this work? (define-syntax my-module-begin (lambda (stx) (syntax-case stx () [(_ body ...) (with-syntax ([sub-id (datum-syntax stx ''sub)]) #'(#%module-begin (module sub

Re: [racket-users] Export indentation preferences in a package's info.rkt?

2015-08-09 Thread Alexander D. Knauth
I would really like to have such a feature. On Aug 9, 2015, at 1:23 PM, Jack Firth jackhfi...@gmail.com wrote: I find it irritating when I have to repeatedly add various macros exported by libraries to their proper group in the Indenting section of DrRacket's settings so that they're

Re: [racket-users] #lang languages and REPL

2015-08-07 Thread Alexander D. Knauth
On Aug 7, 2015, at 4:35 PM, Alexander D. Knauth alexan...@knauth.org wrote: The definition of x in `my-module-begin` doesn't work because it comes from the macro's scope, not from the module's scope. See http://docs.racket-lang.org/reference/syntax-model.html#%28part._macro-introduced

Re: [racket-users] #lang languages and REPL

2015-08-07 Thread Alexander D. Knauth
model of what's happening, Deren​ On Fri, Aug 7, 2015 at 4:32 PM, Alexander D. Knauth alexan...@knauth.org wrote: That sounds weird. You shouldn't need to do anything special with #%top-interaction or anything, so I'm not sure what's going on. How are you defining it? Can you show

Re: [racket-users] #lang languages and REPL

2015-08-07 Thread Alexander D. Knauth
That sounds weird. You shouldn't need to do anything special with #%top-interaction or anything, so I'm not sure what's going on. How are you defining it? Can you show us some of the source code? On Aug 7, 2015, at 1:09 PM, Deren Dohoda deren.doh...@gmail.com wrote: I have a #lang I'm

Re: [racket-users] is this a bug?

2015-08-07 Thread Alexander D. Knauth
On Aug 7, 2015, at 12:27 PM, Michael Titke michael.tied...@o2online.de wrote: I always suspected this to be a logical joke of forcing people to write their own quantifiers and to not let them fall for predicate logic. The best thing about a logic scheme declaring everything but really

[racket-users] Communicating between macros *without* mutation, problems with multiple modules?

2015-08-07 Thread Alexander D. Knauth
Hi. I have been trying to create a macro that communicates without using mutation, but I'm having problems with communicating across multiple modules. I have three files: macro.rkt: #lang racket (provide start add) (require (for-syntax syntax/parse racket/match racket/syntax))

Re: [racket-users] Communicating between macros *without* mutation, problems with multiple modules?

2015-08-07 Thread Alexander D. Knauth
in the same was that `c` is never bound above for `(define (b) c)`. At Fri, 7 Aug 2015 22:02:48 -0500, Alexander D. Knauth wrote: Hi. I have been trying to create a macro that communicates without using mutation, but I'm having problems with communicating across multiple modules. I have

Re: [racket-users] is this a bug?

2015-08-06 Thread Alexander D. Knauth
I believe this pull request is about solving that problem: https://github.com/plt/racket/pull/928 Either through modifying `and` and `or`, or providing variations that can be used with apply and foldr (or other higher-order functions). On Aug 6, 2015, at 10:09 AM, sagyo12341...@gmail.com wrote:

Re: [racket-users] Distinct instantiations of modules

2015-08-06 Thread Alexander D. Knauth
I think namespace-attach-module is one way to do this: #lang racket (module a racket (define ns (make-base-namespace)) (namespace-attach-module (current-namespace) 'racket/promise ns) (parameterize ((current-namespace ns)) (namespace-require 'racket)) (define *promise?

Re: [racket-users] A couple of questions about Neil's html reader/writer

2015-07-29 Thread Alexander D. Knauth
Would it be easier using match? (define (xexpr-tok-tree an-xexpr) (match as-xexpr ['() '()] [(not (cons _ _)) (tok-make ...)] [(list tag) (list tag)] [(list-rest tag (? is-at-list at-list) r2) ] )) On Jul 29, 2015, at 7:56 AM, Thomas Lynch

Re: [racket-users] Question : Local Definition

2015-07-24 Thread Alexander D. Knauth
On Jul 24, 2015, at 11:29 PM, sagyo12341...@gmail.com wrote: Nice to meet you. I'm a racket beginner and I'm not a English speaker. Please forgive my poor skills. In racket tutorials or HtDP, it uses some local definitions, as follows: (define (f x) (local [((define g x) (add1

Re: [racket-users] Question : Local Definition

2015-07-24 Thread Alexander D. Knauth
On Jul 25, 2015, at 12:20 AM, Alexander D. Knauth alexan...@knauth.org wrote: On Jul 24, 2015, at 11:29 PM, sagyo12341...@gmail.com wrote: Nice to meet you. I'm a racket beginner and I'm not a English speaker. Please forgive my poor skills. In racket tutorials or HtDP, it uses

Re: [racket-users] Macro to extract select subexpressions into other locations

2015-07-21 Thread Alexander D. Knauth
Here's a macro that does something similar: #lang at-exp racket (require (for-syntax syntax/parse racket/contract )) (begin-for-syntax (define (get-extracted-exprs-box extracted-exprs-id) (syntax-local-value extracted-exprs-id)) (define

Re: [racket-users] Macro to extract select subexpressions into other locations

2015-07-21 Thread Alexander D. Knauth
Oh. I checked that that the expressions were accumulating in the definition of extract-expression, but I didn't check that it expanded in the right order to do what you want. So this doesn't actually work. On Jul 21, 2015, at 3:08 PM, Alexander D. Knauth alexan...@knauth.org wrote: Here's

Re: [racket-users] Macro introduce identifiers in the new expander

2015-07-20 Thread Alexander D. Knauth
I don't really know what's going on, but this might help: ;; It seems to be introducing the definition correctly, but not the use: ;; this works (let () (def) ; no difference between (def) and (define id 5) id) ;; this doesn't (let () (def) (use)) ; but there is a difference between

[racket-users] Current snapshot: problem with generic interfaces and contracts

2015-07-19 Thread Alexander D. Knauth
This is a simplified example of something that worked in racket version 6.2.0.4 from 2015-06-08, but is now broken in version 6.2.900.4 from 2015-07-17. gen-foo.rkt: #lang racket (provide gen:foo foo? foo/c (contract-out [bar (foo? . - . any/c)])) (require racket/generic) (define-generics foo

[racket-users] Is there a sequence combinator with a for*-like behavior?

2015-07-12 Thread Alexander D. Knauth
I'm wondering if there's anything I can use so that (for/whatever ([(v1 v2 v3) (in-for*-sequence seq1 seq2 seq3)]) ) Would be equivalent to (for*/whatever ([v1 seq1] [v2 seq2] [v3 seq3]) ) The reason I want this because with using for*, I'm constrained by the syntax, and I can't

[racket-users] How to specify fallbacks for generic interfaces without going into an infinite loop?

2015-07-06 Thread Alexander D. Knauth
What is the proper way to do this? This goes into an infinite loop: #lang racket/base (require racket/generic) (define-generics foo (a foo) (b foo) (c foo) #:fallbacks [(define (a foo) (displayln a-fallback) (b foo)) (define (b foo) (displayln b-fallback) (a

Re: [racket-users] How to specify fallbacks for generic interfaces without going into an infinite loop?

2015-07-06 Thread Alexander D. Knauth
) (displayln a-fallback) (gen-b foo)) (define (b foo) (displayln b-fallback) (gen-a foo))]) (struct foo-struct () #:methods gen:foo [(define (a foo) 1)]) (b (foo-struct)) On Mon, Jul 6, 2015 at 9:50 PM, Alexander D. Knauth alexan...@knauth.org wrote: What is the proper

Re: [racket-users] help please on git/github pull request

2015-07-02 Thread Alexander D. Knauth
On Jul 2, 2015, at 6:34 AM, Tim Brown tim.br...@cityc.co.uk wrote: Folks, I have two pull requests related to my separation of net/url-string from net/url. plt/racket #948 implementation of the separation racket/net #4test and documentation of the above My problem is that I have

Re: [racket-users] help please on git/github pull request

2015-07-02 Thread Alexander D. Knauth
On Jul 2, 2015, at 1:53 PM, John Clements cleme...@brinckerhoff.org wrote: On Jul 2, 2015, at 7:31 AM, Alexander D. Knauth alexan...@knauth.org wrote: After you resolve them you will (I think) need to `git add` the files that you resolved conflicts for, then `git rebase --continue

Re: [racket-users] generalised set! in Racket

2015-07-01 Thread Alexander D. Knauth
On Jul 1, 2015, at 4:27 AM, Alexey Cherkaev alexey.cherk...@gmail.com wrote: Hi all, Thanks to all replies, at the moment I would tend to agree that generalised `set!` might not be such a great idea after all: The notion of 'place' is essentially a pointer to a memory location, but it

Re: [racket-users] generalised set! in Racket

2015-06-30 Thread Alexander D. Knauth
On Jun 30, 2015, at 5:34 PM, 'John Clements' via Racket Users racket-users@googlegroups.com wrote: Specifically, one of the basic ideas of algebraic languages is that programs are compositional. Specifically, if I write (a (b x) c), then the meaning of this term depends on the meanings of

Re: [racket-users] generalised set! in Racket

2015-06-29 Thread Alexander D . Knauth
On Jun 29, 2015, at 5:56 AM, Alexey Cherkaev alexey.cherk...@gmail.com wrote: For example, I was thinking of defining syntax to access my implementation of multidimensional arrays as (define-syntax aref (syntax-rules (set!) [(set! (aref ?a ?i ...) ?v) (array-set! ?a ?i ... ?v)]

Re: [racket-users] Fast way to map over a list many times, changing ONE element each time?

2015-06-26 Thread Alexander D. Knauth
Is there a split-at-reverse anywhere, equivalent to split-at except that the first return value is reversed? If not, should that be added somewhere like srfi/1? I’m asking because wanted to be able to write functions like: (define ((drop-lens n) lst) (define-values [fst-lst rst-lst]

Re: [racket-users] try a new macro expander

2015-06-25 Thread Alexander D. Knauth
`splicing-local`, and I'll repair it. Thanks for the report! At Wed, 24 Jun 2015 20:27:39 -0400, Alexander D. Knauth wrote: I’ve just found something that I expected to work, but didn’t: #lang racket/base (require racket/splicing (for-syntax racket/base)) (splicing-local [(define x 1

Re: [racket-users] try a new macro expander

2015-06-24 Thread Alexander D. Knauth
I’ve just found something that I expected to work, but didn’t: #lang racket/base (require racket/splicing (for-syntax racket/base)) (splicing-local [(define x 1)] (define-syntax outer-x (make-rename-transformer #'x))) outer-x ;. outer-x: unbound identifier in module in: outer-x This works

Re: [racket-users] Defining contracts sanely

2015-06-21 Thread Alexander D. Knauth
On Jun 21, 2015, at 5:41 AM, Aidan Gauland aidal...@slingshot.co.nz wrote: Say I want to define a flat contract for the freshness field of my fish class, so I define a contract for it like so: (define/contract fish-freshness/c (- any/c boolean?) (flat-named-contract

Re: [racket-users] Closing big-bang windows

2015-06-21 Thread Alexander D. Knauth
On Jun 21, 2015, at 10:18 PM, Neil Toronto neil.toro...@gmail.com wrote: I'm working on a `big-bang3d` game intended to expose shortcomings in universe-style programs when used at a larger scale than in the classroom. Here are my main criticisms so far: 1. Adding new state is painful.

Re: [racket-users] Reporting Simple Bugs and Fixing Them

2015-06-20 Thread Alexander D. Knauth
On Jun 20, 2015, at 12:39 PM, Kartik Singhal kartiksing...@gmail.com wrote: On Friday, June 19, 2015 at 7:14:56 AM UTC+5:30, Alex Knauth wrote: Also, if you’re interested, I found this blog post helpful: http://www.greghendershott.com/2013/04/a-guide-for-infrequent-contributors-to-racket.html

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-20 Thread Alexander D. Knauth
On Jun 19, 2015, at 7:44 PM, Thomas Dickerson thomas_dicker...@brown.edu wrote: I was intending for that example to have the variables be defined outside the macro, but being able to create the (set! ...) forms outside should mean I could also hypothetically create let/define-values forms.

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-19 Thread Alexander D. Knauth
Are the x, y, and z variables meant to be defined outside the macro by the user as in: (let ([x “something”] [y “something else”] [z “and something else”]) (Loop ….)) ? Or should the Loop macro create a (let ([x 0] [y 0] [z 0]) ….) for you instead? On Jun 19, 2015, at 5:58 PM, Thomas

Re: [racket-users] Reporting Simple Bugs and Fixing Them

2015-06-18 Thread Alexander D. Knauth
You could probably use either one, but a github pull request would be more helpful, I think. Also, if you’re interested, I found this blog post helpful: http://www.greghendershott.com/2013/04/a-guide-for-infrequent-contributors-to-racket.html Although for the HTDP student languages you’d want

Re: [racket-users] DrRacket rendering issues OS X

2015-06-17 Thread Alexander D. Knauth
One data point: I’m using DrRacket version 6.2.0.4--2015-06-08 with OS X Version 10.9.5, and if I remember correctly it was a Racket plus Tests 64-bit installation. I tried those steps, and it worked fine, with no weird black areas, though I do remember occasionally getting similar small black

[racket-users] 3d-syntax and sharing values between read-time and run-time?

2015-06-15 Thread Alexander D. Knauth
I just tried doing something for Asumu Takikawa’s `#lang clojure` with reading sets. In the reader module #{1 2 3} is read, and the reader returns a syntax object created with (datum-syntax … (list-set …) …) And then if I write (quote #{1 2 3}), it actually works? I’m a bit pleasantly

Re: [racket-users] iso-recursive types not allowed in TR?

2015-06-15 Thread Alexander D. Knauth
On Jun 13, 2015, at 8:18 AM, Hendrik Boom hend...@topoi.pooq.com wrote: On Fri, Jun 12, 2015 at 06:06:05PM -0700, 'John Clements' via users-redirect wrote: On Jun 12, 2015, at 5:52 PM, Alexander D. Knauth alexan...@knauth.org wrote: On Jun 12, 2015, at 8:30 PM, 'John Clements' via users

Re: [racket-users] iso-recursive types not allowed in TR?

2015-06-13 Thread Alexander D. Knauth
On Jun 13, 2015, at 12:18 AM, 'John Clements' via users-redirect us...@plt-scheme.org wrote: Okay, I shouldn’t change topics, but while I’ve got you (guys): it looks like (module+ test …) now works in TR, but not when there are imported bindings… suppose I have foo.rkt: I’ve run into

Re: [racket-users] iso-recursive types not allowed in TR?

2015-06-12 Thread Alexander D. Knauth
On Jun 12, 2015, at 8:30 PM, 'John Clements' via users-redirect us...@plt-scheme.org wrote: Here’s the type I want to write: (define-type (HuffJsexpr T) (U T (HashTable Symbol HuffJsexpr))) Do you mean this? (define-type (HuffJsexpr T) (U T (HashTable Symbol (HuffJsexpr T #lang

Re: [racket-users] System Scheme (RnRS): Shared Secret Generator

2015-06-12 Thread Alexander D. Knauth
On Jun 12, 2015, at 9:35 AM, Michael Titke michael.tied...@o2online.de wrote: On 12/06/2015 13:21, Konrad Hinsen wrote: Seeding is provided for two use cases: 1) Reproducibility, ... 2) Real randomization, by setting the seed from some unpredictable source, such as the system time. In

Re: [racket-users] strange bug with racket/gui

2015-06-02 Thread Alexander D. Knauth
I have never worked with a canvas% before (I have worked with a lot of other racket gui stuff), so I have no idea what’s going on, but watch what happens with this: #lang racket (require racket/gui/base) (define frame (new frame% [label Example] [width 300]

Re: [racket-users] How to check for existing definitions

2015-05-31 Thread Alexander D. Knauth
On May 24, 2015, at 3:20 AM, Michael Tiedtke michael.tied...@o2online.de wrote: I can of course use /version/ to check for Racket's version but this doesn't take patches or third party libraries/modules into account. I was just re-reading this, and for your particular use case this has

Re: [racket-users] How to check for existing definitions

2015-05-27 Thread Alexander D. Knauth
On May 27, 2015, at 6:13 AM, Michael Tiedtke michael.tied...@o2online.de wrote: I'm a little bit astonished that Racket doesn't offer a defined? primitve when it's not possible to implement it with macros because of the strange compile-time behavior. Here’s a fairly useless macro that

Re: [racket-users] Flower Garden: Open Flowers

2015-05-25 Thread Alexander D. Knauth
You could also try other options for package sources, which includes things like .zip files and .plt files, in addition to github repositories. http://docs.racket-lang.org/pkg/Package_Concepts.html#%28part._concept~3asource%29 I have no experience with using anything other than a github

Re: [racket-users] Typed racket equivalent of Haskell newtype?

2015-05-24 Thread Alexander D. Knauth
Also opaque types might help you: http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._require%2Ftyped%29%29

Re: [racket-users] test amazes me

2015-05-24 Thread Alexander D. Knauth
Look at what this does: #lang racket (require test-engine/racket-tests) (check-expect 1 1) (check-expect 2 2) (check-expect 3 3) (check-expect (displayln hello) (displayln world)) (test) (test) Welcome to DrRacket, version 6.2.0.3--2015-05-17(542b960/a) [3m]. Language: racket [custom]; memory

Re: [racket-users] Typed racket equivalent of Haskell newtype?

2015-05-23 Thread Alexander D. Knauth
As far as I know, this doesn’t exist in typed racket currently, but I’m wondering: (I’m thinking of seeing if I can implement this when I have time this summer) How should sub-typing interact with this? Should it be a completely separate type, not related by sub-typing at all, or should the

[racket-users] Is there a way to access test submodule from repl in DrRacket?

2015-05-23 Thread Alexander D. Knauth
Is there a way to access definitions in the test submodule from the repl in DrRacket as if I were in the repl of the test submodule? I tried these and they didn’t work: #lang racket (require racket/enter) (module+ test (define x 3)) (enter! (submod try-repl-submod-test.rkt test)) x x:

Re: [racket-users] racket versus racket/base

2015-05-23 Thread Alexander D. Knauth
It sounds to me like you're understanding this perfectly. racket provides all of racket/base for-syntax. On May 23, 2015, at 1:52 PM, Jos Koot jos.k...@gmail.com wrote: This works: #lang racket (define-syntax (x y) (syntax-case y () (_ (syntax (quote monkey) x ; - monkey This does

[racket-users] Is there a way for a function to tell how many values it's caller expects? (the continuation expects?)

2015-05-22 Thread Alexander D. Knauth
Is there a way for a function to tell how many values it’s caller expects it to return? I’ve tried this and it didn’t work: #lang racket (define (show-k-arity) (let/ec k (error 'print-k-arity the arity of k is ~v (procedure-arity k (let-values ([(x y) (show-k-arity)]) (void)) -- You

Re: [racket-users] test submodules vs tests in separate file

2015-05-22 Thread Alexander D. Knauth
If you want to have the contracts enforced in the test submodule, all you have to do is add (require (submod “..”)) to the submodule. You don’t need to use define/contract, and you don’t need to use module* instead of module+. You can just use #lang racket (provide (contract-out ; convert

Re: [racket-users] test submodules vs tests in separate file

2015-05-22 Thread Alexander D. Knauth
On May 22, 2015, at 8:19 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Contracts mediate boundaries between parts of your program and sometimes tests should go across the boundary (to help test the contracts) and sometimes they should go inside (to test internal functions). You have

Re: [racket-users] disappeeraing binding arrows

2015-05-22 Thread Alexander D. Knauth
For me the arrows seem to work fine for both versions. I tried it with racket version 6.1.1 and a racket snapshot build version 6.2.0.3--2015-05-17. Which arrows aren’t working for you? On May 22, 2015, at 1:40 PM, Jos Koot jos.k...@gmail.com wrote: Below two versions of a very stripped

Re: [racket-users] disappeeraing binding arrows

2015-05-22 Thread Alexander D. Knauth
Oh, I thought you were talking about the arrows within the *use* of stx-case. I just realized they don’t work within the *definition* of the second version of stx-case. That is weird. On May 22, 2015, at 3:37 PM, Alexander D. Knauth alexan...@knauth.org wrote: For me the arrows seem to work

Re: [racket-users] Scribble abstraction to attach styles

2015-05-21 Thread Alexander D. Knauth
I don’t know if there’s a better more general solution, but does this do what you want? @(define exercise-style (make-style exercise (list (attributes '([style . margin-left: 0em]) @(define question-style (make-style question (list (attributes '([style . margin-left: 0em]) @(define

Re: [racket-users] Re: Specifying a contract for the end of a list

2015-05-20 Thread Alexander D. Knauth
Would an append/c combinator be a good generalization of this? I’ve already made an append/c combinator that works with just flat-contracts, but is there a good way to make it work for chaperone contracts? https://github.com/AlexKnauth/match-string/blob/master/match-string/main.rkt#L205

Re: [racket-users] Doing pattern matching by reader macro

2015-05-20 Thread Alexander D. Knauth
Here’s one way to do something like that with a macro: https://github.com/AlexKnauth/define-match-spread-out/blob/master/define-match-spread-out/main.rkt And using it: https://github.com/AlexKnauth/define-match-spread-out/blob/master/define-match-spread-out/tests/test.rkt On May 18, 2015, at

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Alexander D. Knauth
On May 18, 2015, at 1:19 AM, Michael Tiedtke michael.tied...@o2online.de wrote: I'm new to Racket but even R5RS is rather clear about this issue: (citation from doc/r5rs/r5rs-std/r5rs-Z-H-9.html) (eq? 2 2) === unspecified In Racket, (eq? 2 2) is specified as true. It says here:

Re: [racket-users] little problem with comma (unquote)

2015-05-14 Thread Alexander D. Knauth
Do you want this: #lang racket (define f 'insertar-empleado) (define exp `(embed/url ,f)) (define (make-func) (define str `(define (func) ,(list 'unquote exp))) str) (display (make-func)) ? On May 14, 2015, at 2:41 PM, Héctor Mc soulras...@gmail.com wrote: Hi for all I'm trying

Re: [racket-users] Getting a sandboxed evaluator to work with a custom #lang's reader

2015-05-12 Thread Alexander D. Knauth
I managed to put this together: https://github.com/AlexKnauth/scribble-code-examples On May 12, 2015, at 7:10 AM, Alexis King lexi.lam...@gmail.com wrote: Continuing my attempts to make a working meta-language, I'm now working on improving the documentation. I'd like to be able to use

Re: [racket-users] Getting a sandboxed evaluator to work with a custom #lang's reader

2015-05-12 Thread Alexander D. Knauth
Is there a way to show examples in scribble docs that uses code? If there’s not, would something like this be good: @code-examples[#:lang “at-exp racket”]|{ (+ 1 2) @+[1 2] }| Renders as: Examples: (+ 1 2) 3 @+[1 2] 3 ? On May 12, 2015, at 7:10 AM, Alexis King lexi.lam...@gmail.com

Re: [racket-users] Why doesn't my readtable extension work in the REPL?

2015-05-11 Thread Alexander D. Knauth
On May 11, 2015, at 4:22 PM, Alexis King lexi.lam...@gmail.com wrote: I’ve gotten my curly-fn meta-language working, and it works great within a module. However, evaluating #{+ 2} within the REPL just evaluates as a plain old vector, ignoring my readtable extension. What gives? Using

[racket-users] testing with scope-set expander on Travis CI?

2015-05-10 Thread Alexander D. Knauth
I want to test some of my packages on travis with the Matthew Flatt's scope-set expander. Right now I’m using Greg Hendershott’s way of setting up the .travis.yml, described here: http://www.greghendershott.com/2013/07/using-travis-ci-for-racket-projects.html I tried modifying that to support

[racket-users] another strange typed racket error

2015-05-09 Thread Alexander D. Knauth
I have been getting an error with one of my packages, and I finally figured out a minimal example of how it breaks. If I have these files: tr-submod-error/lib.rkt: #lang typed/racket (provide x) (define x : Natural 3) (module* untyped racket/base (require (submod ..)) (provide (all-from-out

[racket-users] strange typed-racket contract error

2015-05-08 Thread Alexander D. Knauth
I have this file: #lang typed/racket (provide x) (define x : Natural 3) (module* main racket/base (require typed/racket/base) (require/typed (submod ..) [x Natural])) I get this strange error message: . . ../../../../../Applications/Racket/April-24/Racket

Re: [racket-users] strange typed-racket contract error

2015-05-08 Thread Alexander D. Knauth
: 3.141592653589793 in: #f contract from: (interface for pi) blaming: (interface for pi) (assuming the contract is correct) at: unsaved-editor:3.28 So should require/typed produce a syntax error about being used in an untyped context? On May 8, 2015, at 5:44 PM, Alexander D. Knauth alexan

Re: [racket-users] strange typed-racket contract error

2015-05-08 Thread Alexander D. Knauth
Tobin-Hochstadt sa...@cs.indiana.edu wrote: This appears to be a bug -- my guess is that the contract isn't actually generated, and thus turns into `#f` -- that's what `require/typed` expands to, before TR inserts the real contract. Sam On Fri, May 8, 2015 at 5:26 PM, Alexander D. Knauth

Re: [racket-users] Syntax parameters and renaming

2015-05-06 Thread Alexander D. Knauth
In case you find it interesting, here’s a macro in the implementation of syntax-parse that is similar in spirit: http://git.racket-lang.org/plt/blob/HEAD:/racket/collects/syntax/parse/private/runtime.rkt#l42 On May 6, 2015, at 1:21 AM, Jack Firth jackhfi...@gmail.com wrote: I find that 99% of

Re: [racket-users] performance with freeze from 2htdp/image on very complex images

2015-05-06 Thread Alexander D. Knauth
but to no avail.) Sorry, Robby On Mon, May 4, 2015 at 10:33 PM, Alexander D. Knauth alexan...@knauth.org wrote: On May 4, 2015, at 6:02 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Another approach here would be to help me do performance debugging of 2htdp/image :). You could write

Re: [racket-users] performance with freeze from 2htdp/image on very complex images

2015-05-05 Thread Alexander D. Knauth
On May 5, 2015, at 10:06 AM, Robby Findler ro...@eecs.northwestern.edu wrote: One of the issues is that the racket/draw version is not doing the cropping that the 2htdp/image version is doing. Changing the scene+line call in utils.rkt to add-line cuts the freeze time in half for me (using

Re: [racket-users] performance with freeze from 2htdp/image on very complex images

2015-05-04 Thread Alexander D. Knauth
On May 4, 2015, at 6:02 PM, Robby Findler ro...@eecs.northwestern.edu wrote: Another approach here would be to help me do performance debugging of 2htdp/image :). You could write the code directly as imperative calls to the dc% interface and see how that compares. If there's a significant

[racket-users] performance with freeze from 2htdp/image on very complex images

2015-05-03 Thread Alexander D. Knauth
I’m trying to use 2htdp/image to generate images of fractals. But while generating the images is “relatively” quick, it is freezing the images that’s taking a long time. For the most complicated one, I started it running two nights ago, and the freeze operation on it still hasn’t finished.

Re: [racket-users] Rosetta Code: Level 1st (that's FIRST) with TCL

2015-04-29 Thread Alexander D. Knauth
Would it make sense to implement solutions for #lang sweet-exp racket ? Alex Knauth On Apr 28, 2015, at 7:38 PM, Tim Brown t...@cityc.co.uk wrote: Folks, I've just done a quick burst of cherry picking tasks on Rosetta Code (www.rosettacode.org). I took a quick look at: *

Re: off-topic --- Re: [racket-users] Racketeer - Continuous Testing Plugin for DrRacket

2015-04-26 Thread Alexander D. Knauth
On Apr 26, 2015, at 2:39 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: On Apr 26, 2015, at 9:18 AM, Alexander D. Knauth wrote: I wanted to see if it could work for tests within (module+ test …), and it does (even though check-expect doesn’t, which is weird for check-expect

Re: [racket-users] Racketeer - Continuous Testing Plugin for DrRacket

2015-04-26 Thread Alexander D. Knauth
Well probably check-equal?, check-match, check-pred, check, and check-exn would be the main ones, with check-equal? probably being the most important, but what would be really cool would be something that could generalize over all rackunit checks, so that even checks defined with define-check,

Re: [racket-users] infix notation embedded in Racket

2015-04-24 Thread Alexander D. Knauth
On Apr 24, 2015, at 8:44 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: As it turns out, it is at-exp that are at fault. The screen shot below show that arrows and renaming works when using the infix packages with the syntax: ($ b^2-4*a*x) Note that it works even for

Re: [racket-users] DrRacket internal error

2015-04-22 Thread Alexander D. Knauth
...@eecs.northwestern.edu wrote: Does restarting help? How about re-running 'raco setup'? Robby On Wed, Apr 22, 2015 at 6:21 PM, Alexander D. Knauth alexan...@knauth.org wrote: I’m not sure how it got into this state, but now every time I start typing something or anything like that I get a DrRacket

[racket-users] DrRacket internal error

2015-04-22 Thread Alexander D. Knauth
I’m not sure how it got into this state, but now every time I start typing something or anything like that I get a DrRacket internal error window saying: hash-ref: contract violation expected: hash? given: #f argument position: 1st other arguments...: 'configure-runtime '()

Re: [racket-users] Typed analog of integer-in contract

2015-04-20 Thread Alexander D. Knauth
I’m pretty sure no, although such a type would be nice. If it’s a particular range like Byte, Index, Fixnum, or even something like Byte-Greater-Than-One or Index-that-is-not-a-Byte, then a type already exists, even if it’s not explicitly provided, but otherwise, I don’t think so. You could use

Re: [racket-users] Save as Scribble file extension

2015-04-19 Thread Alexander D. Knauth
Does this change the default extension for #lang at-exp racket too? Because that would be more confusing. If I want to use at-expressions in a normal racket file, I don’t want it to set the default extension to .scrbl. On Apr 19, 2015, at 4:38 PM, Robby Findler ro...@eecs.northwestern.edu

Re: [racket-users] typecheck error with define-namespace-anchor in 6.1.1

2015-04-18 Thread Alexander D. Knauth
I think this was fixed in this commit: https://github.com/plt/racket/commit/03855eb53248f6de46ccfaa71b001a0375156e50 To get rid of that error for 6.1.1, though, you might be able to use something similar to this:

Re: [racket-users] Save as Scribble file extension

2015-04-18 Thread Alexander D. Knauth
I just found this: http://docs.racket-lang.org/tools/adding-languages.html#%28elem._drracket~3adefault-extension%29 But I tried using it by changing the definition of scribble-base-reader-info in scribble/base/reader.rkt to: (define (scribble-base-reader-info) (lambda (key defval default)

  1   2   >