Re: [racket-users] trying to install Rhombus

2023-01-31 Thread Alex Knauth
s://snapshot.racket-lang.org/. The current most up-to-date snapshot available from the University of Utah is version 8.8.0.5. Alex Knauth he/him or they/them -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe fr

[racket-users] Detecting whether failure-result is used by dict-ref using chaperones?

2020-05-21 Thread Alex Knauth
I don't know how to do either of those things. How can I detect whether the `failure-result` is used-or-not by the dict's implementation of `dict-ref`, while keeping the `failure-result` a chaperone of the original failure-result? Alex Knauth -- You received this message because you are s

Re: [racket-users] Typed code from untyped code

2020-02-17 Thread Alex Knauth
The way I we imagined it, it would be implemented like the workaround of a getter function, but with an identifier macro to hide the function from the person using the mutable identifier. Alex Knauth (mobile) > On Feb 17, 2020, at 7:22 PM, Ben Greenman wrote: > > On 2/17/20,

Re: [racket-users] no TR support for streams?

2019-09-07 Thread Alex Knauth
Knauth/typed-racket-stream> I wanted to do this instead of "rolling my own" stream library because I wanted to be able to share the same stream data-structure as existing untyped racket files. Alex Knauth -- You received this message because you are subscribed to the Google

Re: [racket-users] datatypes

2019-07-16 Thread Alex Knauth
> On Jul 17, 2019, at 12:16 AM, Kevin Forchione wrote: > > Hi guys, > Is there any function in Racket that will return a symbol representation of a > value’s datatype? We can interrogate them with predicates, but it occurs to > me that this information must be carried in the object’s syntax

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Alex Knauth
ent-contract-region. If you want to have that `b` be inferred as the current contract region for you, you can use (with-contract a #:result (-> string? integer?) (λ (x) x)) instead of (contract (-> string? integer?) (λ (x) x) 'a (current-contract-region)). Alex Knauth > Are my assumptions

Re: [racket-users] What's wrong with my code?

2019-07-09 Thread Alex Knauth
cement can return #false, and that means you have to replace the result type `Integer` with `(U Integer #f)` for it to type-check. However, that's probably incorrect since an edit-distance should always be defined, so either you need to change how you iterate or handle the #false differently... I'm

Re: [racket-users] macros and let/cc

2019-06-03 Thread Alex Knauth
would know to use it unless it could interrogate the body list > looking for that value. That might be what I’d need to do here… I'm not sure what you mean by interrogate the body, but if you're referring to the syntax-parameterize needing access to the continuation bound by let/cc, then your righ

Re: [racket-users] type annotation example

2019-02-27 Thread Alex Knauth
y need to use 6.0, you can use (String -> Symbol) instead. However if you can upgrade, you probably should. A lot of things have improved in Typed Racket between 6.0 and now. Alex Knauth > Sam > > On Mon, Feb 25, 2019, 1:46 PM Brian Craft <mailto:craft.br...@gmail.com>

Re: [racket-users] Scribble examples for languages other than Racket

2019-01-24 Thread Alex Knauth
Would the `scribble-code-examples` package work for you? https://docs.racket-lang.org/scribble-code-examples/index.html <https://docs.racket-lang.org/scribble-code-examples/index.html> An example use of it might be: @code-examples[#:lang "plisqin" #:context #'here]|{ {where x.F

Re: [racket-users] How to refine types when filtering values

2018-12-24 Thread Alex Knauth
#:+ a))) (define (truthy? v) v) However, you still need to use `inst` on `truthy?` when you pass it to filter: > (filter (inst truthy? Positive-Byte) '(1 2 3 #f)) - : (Listof Positive-Byte) '(1 2 3) Alex Knauth > Thanks, > Wanderley -- You received this message because you are su

Re: [racket-users] Doing file I/O from within a macro

2018-11-01 Thread Alex Knauth
be able to bike > the abstractions you news via the FFI but I guess it will be hard to get > right because DrRacket just kills off compilations effectively randomly. Okay, thanks. > Robby > > On Thu, Nov 1, 2018 at 5:57 PM Alex Knauth <mailto:alexan...@knauth.org>> wrote:

[racket-users] Doing file I/O from within a macro

2018-11-01 Thread Alex Knauth
(λ (stx) (define tmp (make-temporary-file)) (display-to-file "hello there\n" tmp #:exists 'replace) #'(begin))) (m) ;open-output-file: forbidden (write) access to ;/var/folders/6f/5335m44s43g1zd2vqs7jmqshgp/T/unsaved editor-7-16_15411123141541112314481 Alex Knauth -- You r

Re: [racket-users] (set 1) is not equal? to (set 1)

2018-10-18 Thread Alex Knauth
e)` was evaluated twice to create two different namespaces, where in this one `(make-base-namespace)` was evaluated only once, so both eval calls are in the same namespace. Alex Knauth > -- > Tom -- You received this message because you are subscribed to the Google Groups "R

Re: [racket-users] Get contract from function

2018-08-24 Thread Alex Knauth
> On Aug 24, 2018, at 8:50 AM, Joao Pedro Abreu De Souza > wrote: > > Hi. I am contributing in a library that create functions to parse PEG(parsing > expression grammar). To implement a feature, I need to know the return's type > of a function. We are using racket, not typed-racket, so I

Re: [racket-users] Re: From Clojure to Racket

2018-08-23 Thread Alex Knauth
acket-lang.org/collections/index.html> Since these libraries were partly inspired by Clojure's data structures and protocols, they should make it easier to convert your code. Alex Knauth > On Thursday, August 23, 2018 at 6:02:07 PM UTC+1, Ben Kovitz wrote: > Has anyone written

Re: [racket-users] Unicode identifiers

2018-05-16 Thread Alex Knauth
> On May 16, 2018, at 6:37 AM, Jens Axel Søgaard wrote: > > Alternative 1: Use filtered-in to require renamed versions. > > ( <>filtered-in >

Re: [racket-users] [racket] error : Attempted to use a higher-order value passed as `Any` in untyped code:

2018-04-17 Thread Alex Knauth
typed higher-order values, and if the type system knows that through the `UntypedAny` type, the type system will know it is safe to make `cast` behave like `require/typed`. It will know it is safe to pass it only through the Untyped -> Typed boundary. Alex Knauth > On Apr 16, 2018

Re: [racket-users] let-syntax example?

2018-04-03 Thread Alex Knauth
if you want two macros to communicate a compile-time value between them, you can have one of them generate a `let-syntax` or `define-syntax` to define that value, and have the other use `syntax-local-value` to get it. Alex Knauth > Thanks! > Kevin -- You received this message because

Re: [racket-users] Implementation of threading macros

2018-03-31 Thread Alex Knauth
The `~>` form provided by the `threading` package is a macro, and it treats parentheses differently than a normal function would. What you are looking for is probably the ~> *function*, provided by the `point-free` package. That has simpler behavior, doing what you expect with lambdas, curried

Re: [racket-users] Using match to decompose a nested hash

2018-03-20 Thread Alex Knauth
> On Mar 20, 2018, at 11:51 PM, Alex Knauth <alexan...@knauth.org> wrote: > > > >> On Mar 19, 2018, at 11:37 AM, David Storrs <david.sto...@gmail.com> wrote: >> >> This does not work: > >> (define user (hash 'name "bob" 'jo

Re: [racket-users] Using match to decompose a nested hash

2018-03-20 Thread Alex Knauth
ou never meant it to mean. For extra weirdness: #lang racket (define user (hash 'type 'dev 'id 112)) (match user [(hash-table 'type x 'id y) (displayln x)]) ;quote16: unbound identifier; ; also, no #%top syntax transformer is bound in: quote16 This secret feature of `hash-table` patterns

Re: [racket-users] "deleting" syntax properties and macro expander cons-merging

2018-03-11 Thread Alex Knauth
> On Mar 11, 2018, at 2:31 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > > At Sun, 11 Mar 2018 11:27:06 -0400, Alex Knauth wrote: >> In the expander code I found this [1]: >> >> (define (syntax-property-remove s key) >> (if (hash-ref (syntax-props s

Re: [racket-users] "deleting" syntax properties and macro expander cons-merging

2018-03-11 Thread Alex Knauth
> On Mar 10, 2018, at 6:46 PM, Alex Knauth <alexan...@knauth.org> wrote: > > The macro expander merges syntax properties between the input of a macro and > the output of a macro using `cons`. That means that if there is an > identity-macro call like this: > > (i

[racket-users] "deleting" syntax properties and macro expander cons-merging

2018-03-10 Thread Alex Knauth
x) (define-syntax-parser get-prop [(_ x) #`'#,(syntax-property (local-expand #'x 'expression '()) 'prop)]) (define-syntax set-up (λ (stx) (syntax-property #`(id-macro #,(syntax-property #'(void) 'prop #f)) 'prop 5))) (get-prop (set-up)) ; output: (cons #f 5) Alex Knauth

Re: [racket-users] REPL - last output capture?

2018-01-13 Thread Alex Knauth
> On Jan 13, 2018, at 12:56 PM, Michael Rice wrote: > > In Common Lisp it's *, **, ***. > > In Racket? > > Michael In Racket's XREPL, these are called ^, ^^, ..., ^, or you can use $1, $2, ..., $5. The XREPL documentation has more details here:

Re: [racket-users] pragmatics of exhaustiveness checking in TR

2017-12-09 Thread Alex Knauth
> On Dec 9, 2017, at 1:04 PM, 'John Clements' via users-redirect > wrote: > > TR doesn’t really do exhaustiveness checking, really, … except sorta. I’m > mostly just writing this to summarize my thinking and to see if there’s > something obvious I’m missing. The

Re: [racket-users] Interaction of Typed Racket with define/match?

2017-11-13 Thread Alex Knauth
ifferent is which define it's expanding to. So is expanding to Racket's define instead of TR's causing the problem? Alex Knauth > > Thanks, > > Stu -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this

[racket-users] How does a macro properly expand to a define-runtime-path?

2017-11-10 Thread Alex Knauth
e-path is using the macro path. Why? What am I doing wrong?) Alex Knauth -- 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...@googlegrou

Re: [racket-users] let-immutable

2017-11-07 Thread Alex Knauth
r let-immutable because the internal-id will be tainted. Alex Knauth > (define-for-syntax (immutable-variable-transformer new-id) > (make-set!-transformer >(λ (stx) > (syntax-case stx (set!) >[(set! x rhs) > (raise-syntax-error #f "cannot mutate

Re: [racket-users] Multiple namespaces in Racket

2017-10-12 Thread Alex Knauth
o use a provide-transformer. Is there any way around this? What I have so far: https://gist.github.com/AlexKnauth/b7d9f2e0af1c5b8e2186d6581b1f7e4d <https://gist.github.com/AlexKnauth/b7d9f2e0af1c5b8e2186d6581b1f7e4d> Alex Knauth -- You received this message because you are subscribed to

Re: [racket-users] table lookup shorthands?

2017-08-16 Thread Alex Knauth
> On Aug 8, 2017, at 10:42 AM, Luis Sanjuán <luisj.sanj...@gmail.com> wrote: > > On Tuesday, August 8, 2017 at 3:16:46 PM UTC+2, Alex Knauth wrote: >> I've been basing it on the chord-labeling algorithm in a paper I found, >> "Algorithms for Chordal Analys

Re: [racket-users] table lookup shorthands?

2017-08-08 Thread Alex Knauth
d longer passing tones or suspensions in the melody, it gives more weight to the passing tones and suspensions. Is that similar to the strategy you used? Is there any way to deal with passing tones like this? Alex Knauth -- You received this message because you are subscribed to the Goog

Re: [racket-users] table lookup shorthands?

2017-08-06 Thread Alex Knauth
> On Aug 6, 2017, at 6:16 PM, Jordan Johnson wrote: > > Hi all, > > I’m writing some music-related code for which I find myself using a lot of > lookup tables, following the pattern of making an alist or hash table and > then writing a function that consults the table.

Re: [racket-users] for/list with in-parallel lists

2017-07-10 Thread Alex Knauth
> On Jul 11, 2017, at 12:38 AM, Nadeem Abdul Hamid wrote: > > ... though a syntactic solution combining for and match would probably > be better. > > Yes, please!... > Look, python can do it: > > >>> [(x, z) for (x, y, z) in [(1, 2, 3), (4, 5, 6), (7, 8, 9), ('a', 'b', > >>>

Re: [racket-users] Forwarding syntax or srcloc

2017-07-05 Thread Alex Knauth
> On Jul 4, 2017, at 4:39 PM, reilithion wrote: > > I need to somehow forward the srcloc of its use-location. Look up syntax/loc. You should use it in simple-data to forward the source location to mk-data. > There are going to be a lot of macros like simple-data, and

Re: [racket-users] Indentation of for-clauses

2017-06-13 Thread Alex Knauth
ke: (=0 =2(=1) +0(=1)) match-like: (=0 =4 =2(=1) +0(=1)) match*-like: (=0 =4(=1) =2(=1(=1) =1) +0(=1(=1) =1)) Does this language make sense as a specification for indentation rules? Alex Knauth -- You received this message because you are subscribed to the Google Groups

Re: [racket-users] using a created language in the repl

2017-05-17 Thread Alex Knauth
der or not. However from your reader module it looks like you're using the default reader, so most likely just re-providing racket's #%top-interaction from "base.rkt" will work. Alex Knauth -- You received this message because you are subscribed to the Google Groups "Racket Us

Re: [racket-users] How to apply side effects to all elements in a list

2017-03-22 Thread Alex Knauth
case.) Angus, what happens when you try writing your program in one of the teaching languages, like Beginning Student Language? Those were designed to help programmers when they make beginner-type mistakes. Also, the stepper John Clements is referencing is only available in the teaching lan

Re: [racket-users] syntax-parse: using expr/c with ~optional

2017-03-20 Thread Alex Knauth
(syntax-parser [(_ (~or (~seq #:return val) (~and (~seq) (~parse val #'42 #:declare val (expr/c #'(or/c list? #f)) #'val.c])) (example) This raises the contract violation you expected. Alex Knauth -- You received this message because you are subscribed to the G

Re: [racket-users] How does syntax-local-expand-expression work?

2017-01-27 Thread Alex Knauth
the helper in an expression context (define-syntax-parser local-expanding-transformer [(_ e:expr) #'(#%expression (local-expanding-transformer-helper e))]) (local-expanding-transformer (+ 1 2)) Alex Knauth > On Jan 27, 2017, at 12:43 PM, Alexis King <lexi.lam...@gmail.com> wrote: &

Re: [racket-users] Dynamic-require a compile-time identifier?

2017-01-21 Thread Alex Knauth
(#%module-begin (only-meta-in 0 (for-meta ,phase ,mod*) (dynamic-require ''mod-for-phase sym))) (dynamic-require-for-meta "x.rkt" -1 'x) This isn't meant to require macro transformers; it's only meant to require things that were provided for-syntax. Thanks, Alex Knauth -- Y

Re: [racket-users] Serializing macro transformer procedures

2017-01-20 Thread Alex Knauth
ime body (syntax-case stx () [(_ e) #'e]))) (debug-repl)) Alex Knauth > -Philip > > On Wed, Jan 18, 2017 at 6:24 PM, Alex Knauth <alexan...@knauth.org > <mailto:alexan...@knauth.org>> wrote: > I'm trying to use serial-lambda in macro transformer procedures so th

[racket-users] Dynamic-require a compile-time identifier?

2017-01-18 Thread Alex Knauth
c-require '(submod "x.rkt" ct) 'x) But that requires an extra module to be defined already. I could also do it with eval, but that feels wrong and shouldn't be necessary. There should be a way to do this without needing eval. Alex Knauth -- You received this message because you are subscribed

[racket-users] Serializing macro transformer procedures

2017-01-18 Thread Alex Knauth
; it works fine in a begin-for-syntax (as long as you don't try to deserialize). What's the real reason it doesn't work in a define-syntax? Is there another way to bring macro transformer procedures down to run-time? Alex Knauth -- You received this message because you are subscribed to the Google

Re: [racket-users] can't open/start DrRacket v6.8.0.2 on macOS Sierra 10.12.2

2017-01-18 Thread Alex Knauth
the v6.7.0.1 I had been using, but I was hoping to try out the latest > and greatest. I had this problem too, but running raco setup fixed it. Also, opening DrRacket from the command line via ./bin/drracket should work within the Racket v6.8.0.2 directory. Alex Knauth > Geoff -- You receiv

Re: [racket-users] Copying a namespace?

2017-01-12 Thread Alex Knauth
> On Jan 12, 2017, at 5:33 PM, Alex Knauth <alexan...@knauth.org> wrote: > > >> On Jan 12, 2017, at 7:43 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >> >> My thought is similar to Robby's: Does it work to add a fresh scope to >> every identifier

Re: [racket-users] Copying a namespace?

2017-01-12 Thread Alex Knauth
pe. Okay. Interestingly, this solution works great on 6.7 and HEAD, but not on 6.6 and earlier. What changed? Alex Knauth > At Wed, 11 Jan 2017 18:41:01 -0500, Alex Knauth wrote: >> Hello, >> >> I want to shadow instead of mutate. >> >> The ideal solution would

Re: [racket-users] Copying a namespace?

2017-01-11 Thread Alex Knauth
> On Jan 11, 2017, at 9:10 PM, Robby Findler <ro...@eecs.northwestern.edu> > wrote: > > On Wed, Jan 11, 2017 at 7:59 PM, Alex Knauth <alexan...@knauth.org> wrote: >> >>> On Jan 11, 2017, at 8:53 PM, Robby Findler <ro...@eecs.northwestern.edu>

Re: [racket-users] Copying a namespace?

2017-01-11 Thread Alex Knauth
ach of putting the macro system to > work seems like the right approach. What do you mean by that? What do I stick `let`s around? I don't think I could do it by overriding current-eval, because I want definitions to work in the debug-repl. So what did you mean? Alex Knauth > Robby >

[racket-users] Copying a namespace?

2017-01-11 Thread Alex Knauth
> x 1 ; outside the debug-repl, x is 1 > (define (f x) (debug-repl)) > (f 2) -> x 2 ; inside the debug-repl, x is 2 -> ; exit the debug-repl > x 2 ; x should be 1, but it mangled the namespace Is there a way to do this without mangling the original namespace? Alex Knauth -- You

Re: [racket-users] Narrow radix of string->number.

2017-01-04 Thread Alex Knauth
gits->number (list 50 73) 90) ;=> 4573 Then using an arbitrary alphabet could work by replacing numbers within a list instead of finding sequences within a string, which sounds much more hacky. Alex Knauth > Robby > > On Wed, Jan 4, 2017 at 12:46 PM, Deren Dohoda <dere

Re: [racket-users] How to write string-match?

2016-12-20 Thread Alex Knauth
> On Dec 20, 2016, at 3:45 PM, Alexis King <lexi.lam...@gmail.com> wrote: > >> On Dec 20, 2016, at 07:54, Alex Knauth <alexan...@knauth.org> wrote: >> >> Oooh, that's pretty cool. Much better than my super-slow attempt. >> >> Should you make thi

Re: [racket-users] How to write string-match?

2016-12-20 Thread Alex Knauth
> On Dec 20, 2016, at 4:35 AM, Alexis King wrote: > > One relatively easy solution would be to just compile patterns to > regular expressions and use Racket’s built-in match form. Writing this > as a match-expander is fairly straightforward: > > #lang racket > >

Re: [racket-users] Typed Racket guard a binding with an error

2016-12-12 Thread Alex Knauth
ped/racket (define ls (port->list read (open-input-string "1 2 3 4"))) (for ([n (assert ls (λ ([ls : (Listof Any)]) (andmap number? ls)))]) (displayln (* n n))) Alex Knauth -- You received this message because you are subscribed to the Google Groups "Racket Users" group

Re: [racket-users] format-id doesn't preserve preserved?-edness of syntax-property?

2016-12-11 Thread Alex Knauth
)) (syntax-property-preserved? stx* 'my-prop) ;=> #true Alex Knauth > In "format-id1.rkt" > (https://gist.github.com/wilbowma/247d15e0e0bed6b239584854e79b5015), I define > and export some identifiers with preserved syntax-properties. The identifier > &qu

Re: [racket-users] Language-provided bindings and arrows in DrRacket

2016-12-04 Thread Alex Knauth
out how scopes work with requires. Alex Knauth > Here is the modified "MyLang.rkt": > > #lang racket > (provide (rename-out [my-module-begin #%module-begin])) > (define-syntax (my-module-begin stx) > (syntax-case stx () >[(_ real-lang body) > (syn

Re: [racket-users] list-free syntax

2016-11-19 Thread Alex Knauth
l use the old value of the parameter, and using the other it would use the new version after (do-something-that-could-affect-the-parameter). Which do you want? Alex Knauth > Best regards, > > Dmitry -- You received this message because you are subscribed to the Google Groups &quo

Re: [racket-users] list-free syntax

2016-11-19 Thread Alex Knauth
sformer-helpers.html#(def._((lib._syntax/transformer..rkt)._make-variable-like-transformer))> Using that your macro would be: (define-syntax call-my-func (make-variable-like-transformer #'(my-func))) Alex Knauth > Best regards, > > Dmitry > > On 11/19/2016 01:10 PM, Dmitry Pa

Re: [racket-users] If a thunk is a proc of zero arguments, what is a proc of one argument?

2016-11-12 Thread Alex Knauth
> On Nov 12, 2016, at 4:22 PM, David Storrs wrote: > > The 'thunk' procedure is really useful and is sprinkled liberally through my > code because it saves keystrokes / is clearer than (lambda () ...). I often > find myself writing (lambda (x) ...) for something and

Re: [racket-users] Declaring structs as final?

2016-11-07 Thread Alex Knauth
perones.html?q=chaperone-struct-type#%28def._%28%28quote._~23~25kernel%29._chaperone-struct-type%29%29 >> >> You can just have the guard always error. >> >> Sam >> >> On Fri, Nov 4, 2016 at 4:49 PM, Alex Knauth <alexan...@knauth.org> wrote: >>> >&

Re: [racket-users] Declaring structs as final?

2016-11-04 Thread Alex Knauth
> On Nov 4, 2016, at 4:43 PM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> wrote: > > Typed Racket chaperones the struct type to prevent further extension. Ok, thanks. Where would I go to see how I would create a chaperone like this? > Sam > > On Fri, Nov 4, 2016 at 4:29

[racket-users] Declaring structs as final?

2016-11-04 Thread Alex Knauth
Typed Racket do to do do that? Alex Knauth -- 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. For more opti

Re: [racket-users] Searching in data the Racket way...

2016-10-30 Thread Alex Knauth
> On Oct 31, 2016, at 12:31 AM, Alex Harsanyi wrote: > > While in terms of O-notation, all linear algorithms are equivalent, the > actual time to run a linear algorithm can significantly depend on the actual > data structure. In the program below, I calculate the sum

Re: [racket-users] Drawing arbitrary binding arrows with Check Syntax

2016-10-19 Thread Alex Knauth
identifier=? otherwise. Is that the behavior that makes sense for check-syntax arrows? Alex Knauth -- 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 racke

Re: [racket-users] creating a REPL for your #lang?

2016-10-18 Thread Alex Knauth
> On Oct 18, 2016, at 6:10 PM, Chris GauthierDickey wrote: > > Greetings all, > > Googled around and searched through documents but I couldn't find an > answer. Me and a colleague built a #lang on top of racket and I've been able > to get it to run in the Definitions

Re: [racket-users] udelim package -- more parens than you can shake a stick at

2016-09-25 Thread Alex Knauth
> On Sep 25, 2016, at 3:55 AM, William G Hatch <will...@hatch.uno> wrote: > > On Sat, Sep 24, 2016 at 05:33:18PM -0400, Alex Knauth wrote: >> The way racket already does this is with a 'paren-shape syntax property, >> which you can ignore if you want to use 「」 as a

Re: [racket-users] udelim package -- more parens than you can shake a stick at

2016-09-24 Thread Alex Knauth
ch syntax lists with a 'paren-shape property of #\( . Are there any alternative ways to solve these problems? Alex Knauth -- 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 i

Re: [racket-users] Is there a predefined (define-runtime-path "this_file")?

2016-09-23 Thread Alex Knauth
2Flocation..rkt%29._quote-source-file%29%29 You can also read Greg Hendershott's blog post about writing macros like this: http://www.greghendershott.com/2014/06/-file-and-line-in-racket.html Alex Knauth > In Perl I can do this: > > > I'd like to be able to access files at run

Re: [racket-users] [ANN] New package: live-free-or-die

2016-09-22 Thread Alex Knauth
you want to be unsafe. This is worse, but not because of the optimizer; because of the all-or-nothing part. Alex Knauth -- 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

Re: [racket-users] Using the base language’s get-info function with make-meta-reader

2016-09-10 Thread Alex Knauth
ge’s get-info function to direct how reading should work. > > Alexis > >> On Sep 6, 2016, at 9:19 PM, Alex Knauth <alexan...@knauth.org> wrote: >> >> I have no idea whether this works or not; it's completely untested. I took >> the existing implement

Re: [racket-users] Typed racket and continuations

2016-08-30 Thread Alex Knauth
an work on it, and you can call `f` within the then-branch. > (let ([f d-or-s]) (if f (f 1) "it wasn't a function")) 1 Alex Knauth -- 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. For more options, visit https://groups.google.com/d/optout.

Re: [racket-users] DrRacket's auto-indentation outside DrRacket?

2016-08-25 Thread Alex Knauth
> On Aug 25, 2016, at 6:17 PM, Dupéron Georges > wrote: > > Le vendredi 26 août 2016 00:02:13 UTC+2, Matthias Felleisen a écrit : >> The specification has to come with feature and/or the language, not the >> tool. How would Emacs know about it? Or Notepad? Every

Re: [racket-users] Using the base language’s get-info function with make-meta-reader

2016-08-24 Thread Alex Knauth
t question I had about what the second argument was, but then I had other things to do and I never finished it. If I have more time in the next 2 weeks I could look at it again... Alex Knauth > Currently, my guess is the answer is a fairly flat “no”, but I > figured I’d ask in case I was miss

Re: [racket-users] warnings for requiring opaque types in typed racket 6.6

2016-08-19 Thread Alex Knauth
more in the spirit of the `#:exists` option in `contract-out`. This would wrap the values of this type in a new opaque structure that it knows how to chaperone. Alex Knauth > Hi all, > > I note that Racket 6.6 now issues warnings for certain generated > contracts in typed/unty

Re: [racket-users] racket command-line REPL: Constructor style printing mode?

2016-08-10 Thread Alex Knauth
> On Aug 10, 2016, at 9:08 AM, Robby Findler <ro...@eecs.northwestern.edu> > wrote: > > On Wed, Aug 10, 2016 at 8:10 AM, Alex Knauth <alexan...@knauth.org> wrote: >>> I believe this fixes a bug in DrRacket but the way these handlers are >>> set u

Re: [racket-users] racket command-line REPL: Constructor style printing mode?

2016-08-10 Thread Alex Knauth
do the same thing, which is *not* print a newline, because `print` doesn't print one (that's `println`'s job). > #lang racket > (global-port-print-handler > (λ (val port [depth 0]) > (fprintf port "~s" val))) > > 1 2 3 > > Robby > > > On Wed, Aug

Re: [racket-users] racket command-line REPL: Constructor style printing mode?

2016-08-10 Thread Alex Knauth
doing something weird now, that it wasn't doing before. In 6.0, it prints the newlines properly, but in 6.6.0.2 it works on the command-line but not in DrRacket. Did DrRacket change it's behavior recently? Alex Knauth > Thanks for the feedback, Alex. > > Delphine -- You receive

Re: [racket-users] racket command-line REPL: Constructor style printing mode?

2016-08-10 Thread Alex Knauth
ket/racket/pull/1137 I need to update it and change it to add a keyword argument to each function. Then `constructor-style-print` could pretty-print it without needing the newline. Alex Knauth > This is closer to the behavior of drracket's constructor style printing. > Maybe there are bet

Re: [racket-users] syntax -> normalized-arity

2016-08-09 Thread Alex Knauth
lowed-kws for the keywords > (kw-formals->arity #'(x)) 1 > (kw-formals->required-kws #'(x #:y y)) '(#:y) > (kw-formals->allowed-kws #'(x #:y y)) '(#:y) > (kw-formals->required-kws #'(x #:y [y 5])) '() > (kw-formals->allowed-kws #'(x #:y [y 5])) '(#:y) Alex Knauth

Re: [racket-users] racket command-line REPL: Constructor style printing mode?

2016-07-28 Thread Alex Knauth
res two newlines after input expressions though. > Strange indeed :-) The same happens for me (both on v6.0 and v.6.6). But I > can live with that for a while. Now that it doesn't use the sweet-exp reader any more, it only requires one newline. Alex Knauth -- You received this

Re: [racket-users] Re-using an identifier as a submodule name?

2016-07-17 Thread Alex Knauth
produced this error? I mentioned in my earlier email that this definition worked in my small example in the case where it was the only thing doing this scope stuff. So what were the other macros that interacted to give you the ambiguous binding error? Alex Knauth -- You received this me

Re: [racket-users] Macros that use with-handlers

2016-07-16 Thread Alex Knauth
entifier, and (syntax->datum (syntax pred)) will return a symbol, not a procedure. At compile-time that's all you know. It could be an identifier that happens to be bound to a procedure, or it could be an identifier bound to a number, or it could have no definition at all. So, for simple lit

Re: [racket-users] Macros that use with-handlers

2016-07-16 Thread Alex Knauth
> On Jul 16, 2016, at 2:16 PM, David Storrs wrote: > > I'm trying to write a macro to test expected exceptions. I'd like it > to have the following forms: > > (throws exception-generator-function proc msg) > (throws exception-generator-function string msg) > > Where

Re: [racket-users] get the contract of a (or any) function - or find matching functions

2016-07-16 Thread Alex Knauth
you might still be able to use the typed-racket types in some way. I don't know how you would want to use them though. Alex Knauth -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop r

Re: [racket-users] Re-using an identifier as a submodule name?

2016-07-15 Thread Alex Knauth
work within the body of the `func` function, for example? #lang racket (require syntax/parse/define) (define (helper1 v) 'normal-behavior) (define (helper2 v) 'normal-behavior) (helper1 'a) (helper2 'b) (module foo racket/base (module+ func (define (helper1 v) 'func-behavior) (define (hel

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-14 Thread Alex Knauth
> On Jul 14, 2016, at 5:11 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > > At Thu, 14 Jul 2016 16:01:52 -0400, Alex Knauth wrote: >> Ok, by using `syntax-debug-info` I was able to get somewhere. However, I >> want >> to make the variables I'm putting

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-14 Thread Alex Knauth
n't `(eval '(define-syntax ))` having any effect? Or is there any other way to define a transformer binding into a namespace? Alex Knauth > On Jul 13, 2016, at 8:51 PM, Alex Knauth <alexan...@knauth.org> wrote: > > Would `syntax-debug-info` help here? Would the `'bin

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
`syntax-debug-info` help here? Would the `'bindings` option have the information I want? Alex Knauth > On Wed, Jul 13, 2016 at 6:32 PM, Alex Knauth <alexan...@knauth.org> wrote: >> >>> On Jul 13, 2016, at 7:25 PM, Robby Findler <ro...@eecs.northwestern.edu> >

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
s from the lexical context of the syntax object, if that's possible. Alex Knauth > On Wed, Jul 13, 2016 at 2:33 PM, Alex Knauth <alexan...@knauth.org> wrote: >> >>> On Jul 13, 2016, at 3:28 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >>> >>> A

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Jul 13, 2016, at 3:28 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > > At Wed, 13 Jul 2016 14:16:11 -0400, Alex Knauth wrote: >> >> Thanks. So defining it as a function won't work. But if I define it as a >> macro, can I get more information out of it? &g

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Jul 13, 2016, at 11:22 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > > At Wed, 13 Jul 2016 11:10:30 -0400, Alex Knauth wrote: >> Ok. Is there a way to set up a namespace that would have those local >> variables? Would a `(#%variable-reference)` help here? Or is

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Sun, Jul 10, 2016 at 8:29 PM, Alex Knauth <alexan...@knauth.org> wrote: >> I'm doing a weird thing. I'm trying to use the lexical information from a >> `(quote-syntax here #:local)` syntax object to access local variables. It >> can distinguish between bo

[racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-10 Thread Alex Knauth
les (debug-repl/stx (quote-syntax here #:local))) (f 1 2) Alex Knauth -- 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...@goo

Re: [racket-users] Confused about the get-info function for #langs

2016-07-01 Thread Alex Knauth
yntax/module-reader interface seems to make a >> lot more sense for the vast majority of languages. >> >> That’s all I got, though. If you find out something more definitive, >> centralizing this information in the documentation would be much >> appreciated! &

[racket-users] Confused about the get-info function for #langs

2016-06-29 Thread Alex Knauth
ng, which it passes as the second argument to the original `get-info` function, and then passes the result of that to the `convert-get-info` function. I am thoroughly confused by all of this. Can someone explain how the `get-info` function is supposed to work? Alex Knauth -- You receiv

Re: [racket-users] Require Transformers

2016-06-29 Thread Alex Knauth
> On Jun 29, 2016, at 9:05 AM, Shakna Israel wrote: > > I'm trying to introduce an implicit binding for require. > > One of the features I love about Python, is the namespace binding. > > import sys > > sys.stdout.write("Sweet") > > I know this can also be accomplished

Re: [racket-users] interested in TR internal error?

2016-06-27 Thread Alex Knauth
> On Jun 25, 2016, at 6:25 PM, 'John Clements' via Racket Users > <racket-users@googlegroups.com> wrote: > >> On Jun 24, 2016, at 1:15 PM, Alex Knauth <alexan...@knauth.org> wrote: >> >>> On Jun 24, 2016, at 1:13 PM, 'John Clements' via Racket Users

Re: [racket-users] interested in TR internal error?

2016-06-24 Thread Alex Knauth
sumu and I thought we fixed it, and we tested it, but maybe we didn't test it thoroughly enough? Anyway I would be interested in how you got this error. Alex Knauth -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from

[racket-users] Weird syntax-parse/macro-expansion question

2016-06-21 Thread Alex Knauth
e clauses checks and propagates a syntax property downward onto its sub-expressions, while the other propagates a syntax property upward from its sub-expressions. The calls to expand (in my case local-expand) are necessary because it needs to look at the property on the expanded syntax object.

  1   2   >