Re: [racket-users] trying to install Rhombus

2023-01-31 Thread Alex Knauth
ptions at https://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

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

2020-05-21 Thread Alex Knauth
27;m constrained to chaperones, 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 --

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
hub.com/AlexKnauth/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

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 s

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Alex Knauth
urrent-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

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

2019-07-09 Thread Alex Knauth
old` replacement 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 dif

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

2019-06-03 Thread Alex Knauth
> (or how it 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 continuati

Re: [racket-users] type annotation example

2019-02-27 Thread Alex Knauth
really 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]|{ {wher

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

2018-12-24 Thread Alex Knauth
: (∀ (a) (-> (U a False) Any : #:+ 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

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
)) (define-syntax m (λ (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_15411123141541112

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

2018-10-18 Thread Alex Knauth
your example, `(make-base-namespace)` 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 subsc

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 thi

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

2018-08-23 Thread Alex Knauth
;https://docs.racket-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 w

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 > > proc-expr require-s

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

2018-04-17 Thread Alex Knauth
those 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, 201

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

2018-04-03 Thread Alex Knauth
nt 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 you are subscr

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 wrote: > > > >> On Mar 19, 2018, at 11:37 AM, David Storrs wrote: >> >> This does not work: > >> (define user (hash 'name "bob" 'job (hash 'type 'dev 'id 112))) >&g

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

2018-03-20 Thread Alex Knauth
hing completely different that you 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:

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 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) key

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 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: > > (identity-macro x) > > wh

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

2018-03-10 Thread Alex Knauth
fine-simple-macro (id-macro x) 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)) 'p

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: https://docs.racket-lang.org/xrepl/index.

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 Utilities section of the TR

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

2017-11-13 Thread Alex Knauth
) [((vector a b) (vector c d) e) (and (= a (+ c e)) (= b (+ d e)))])) Others: Does define/match do anything that would make Typed Racket see it differently from define + match*? It seems like define/match expands to define + match*/derived anyway. The only thing that's different

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

2017-11-10 Thread Alex Knauth
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...@googlegroups.com.

Re: [racket-users] let-immutable

2017-11-07 Thread Alex Knauth
27;t succeed in breaking your 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-e

Re: [racket-users] Multiple namespaces in Racket

2017-10-12 Thread Alex Knauth
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 the Google Groups "Racket Users" group. T

Re: [racket-users] table lookup shorthands?

2017-08-16 Thread Alex Knauth
> On Aug 8, 2017, at 10:42 AM, Luis Sanjuán 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 Analysis" by Bryan Pardo and Will

Re: [racket-users] table lookup shorthands?

2017-08-08 Thread Alex Knauth
assing 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 Google Groups "

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. I wound up writing a ma

Re: [racket-users] Positional arguments in syntax classes

2017-07-24 Thread Alex Knauth
> On Jul 24, 2017, at 1:06 PM, Sam Waxman wrote: > > Probably a silly question but I can't figure out how to get this working. > > I want to have a syntax class that I can pass arguments into. So, > > (define-syntax-class (my-syn-class argument) > ... > ) > > (syntax-parse #'some-syntax > [

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', > >>> 'c')]] > [(1, 3)

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 some of them may > be wr

Re: [racket-users] noob question: generic interfaces & classes

2017-06-25 Thread Alex Knauth
ric-methods) (define i<%> (interface* () ([(generic-property gen:custom-write) (generic-method-table gen:custom-write (define (write-proc obj port mode) (void)))]))) However, it might be better for someone to make a pull request to u

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

2017-06-13 Thread Alex Knauth
) +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 "Racket Users"

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

2017-05-17 Thread Alex Knauth
ot. 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 Users

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

2017-03-22 Thread Alex Knauth
ing 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 languages. Alex Knauth -- You received this message bec

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 t

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

2017-01-27 Thread Alex Knauth
s 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 wrote: > > Given t

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

2017-01-21 Thread Alex Knauth
ule-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,

Re: [racket-users] Serializing macro transformer procedures

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

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

2017-01-18 Thread Alex Knauth
ire '(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 yo

[racket-users] Serializing macro transformer procedures

2017-01-18 Thread Alex Knauth
a lie; 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

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

2017-01-18 Thread Alex Knauth
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 received this

Re: [racket-users] Copying a namespace?

2017-01-12 Thread Alex Knauth
> On Jan 12, 2017, at 5:33 PM, Alex Knauth wrote: > > >> On Jan 12, 2017, at 7:43 AM, Matthew Flatt wrote: >> >> My thought is similar to Robby's: Does it work to add a fresh scope to >> every identifier that you bind in the debug REPL and also add th

Re: [racket-users] Copying a namespace?

2017-01-12 Thread Alex Knauth
ingly, 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 be to create a new

Re: [racket-users] Copying a namespace?

2017-01-11 Thread Alex Knauth
x solution seems to work for normal (non-macro) identifiers. Thanks for suggesting it! This still has more problems to work out though. Alex Knauth > Robby -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this grou

Re: [racket-users] Copying a namespace?

2017-01-11 Thread Alex Knauth
> On Jan 11, 2017, at 9:10 PM, Robby Findler > wrote: > > On Wed, Jan 11, 2017 at 7:59 PM, Alex Knauth wrote: >> >>> On Jan 11, 2017, at 8:53 PM, Robby Findler >>> wrote: >>> >>> That might work. It might be easier to just stick in so

Re: [racket-users] Copying a namespace?

2017-01-11 Thread Alex Knauth
tem 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 > > On Wed, Jan 11, 20

[racket-users] Copying a namespace?

2017-01-11 Thread Alex Knauth
; (define x 1) > 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 K

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

2017-01-04 Thread Alex Knauth
> 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 wrote: >> Some food for thought on this

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

2016-12-20 Thread Alex Knauth
> On Dec 20, 2016, at 3:45 PM, Alexis King wrote: > >> On Dec 20, 2016, at 07:54, Alex Knauth wrote: >> >> Oooh, that's pretty cool. Much better than my super-slow attempt. >> >> Should you make this into a package (I would certainly use it a lot) &

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 > > (require (for-syntax racket/s

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

2016-12-12 Thread Alex Knauth
a: #lang typed/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

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

2016-12-11 Thread Alex Knauth
d? it's still marked as preserved in the program below. #lang racket (require racket/syntax) (define stx (syntax-property #'x 'my-prop 5 #t)) (syntax-property-preserved? stx 'my-prop) ;=> #true ;; transfer properties from stx (define stx* (format-id #f "y" #:props stx)

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

2016-12-04 Thread Alex Knauth
/www.cs.utah.edu/plt/scope-sets/general-macros.html#%28part._.Modules_and_.Phases%29 <http://www.cs.utah.edu/plt/scope-sets/general-macros.html#(part._.Modules_and_.Phases)> I can't see any unwanted consequences of this approach, but I also don't know much about how scopes

Re: [racket-users] list-free syntax

2016-11-19 Thread Alex Knauth
ue 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 "Racket Users"

Re: [racket-users] list-free syntax

2016-11-19 Thread Alex Knauth
tml#(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 Pavlov wrot

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 wishing that there was >

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

2016-11-07 Thread Alex Knauth
> On Nov 4, 2016, at 4:58 PM, Sam Tobin-Hochstadt wrote: > > Here's an example: Oh, so this only raises an error when creating an *instance* of y, not when creating the struct-type for y. Is there any way to make it raise an error on the make-struct-type call? Alex Knauth

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

2016-11-04 Thread Alex Knauth
> On Nov 4, 2016, at 4:43 PM, Sam Tobin-Hochstadt 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 PM, Alex Knauth wrote: &

[racket-users] Declaring structs as final?

2016-11-04 Thread Alex Knauth
ucts. What does 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

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 of the elements of > a v

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

2016-10-19 Thread Alex Knauth
'disappeared-binding, I would want it to go by the scopes (bound-identifier=?), because there is no binding to look at. For most of the macros I've made using this, I have wanted it to use free-identifier=? if there is a binding, but bound-identifier=? otherwise. Is that the behavio

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 window of Dr Racket bu

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 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 normal visually

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

2016-09-24 Thread Alex Knauth
could mean only match 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 a

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

2016-09-23 Thread Alex Knauth
uote-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 runtime that have a

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

2016-09-22 Thread Alex Knauth
#x27;( Like, as far as I can > tell, this is even worse then typed/racket/unsafe, as the optimizer is still > run. O_o Also, with typed/racket/unsafe the optimizer *is* still run, so that's not any better *unless* you selectively choose what you want to be unsafe. This is worse, but

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

2016-09-10 Thread Alex Knauth
ing it in a package somewhere. I don’t have any > immediate plans to do that yet, though, so somebody might find some > use for this code in the meantime. I’ve successfully used this code > to implement a language extension that uses the result of a base > language’s get-info function to

Re: [racket-users] Typed racket and continuations

2016-08-30 Thread Alex Knauth
nce it is not a function type in: (d-or-s 1) However, it raises the same type error as before. The reason is that `d-or-s` being mutable messes it up. The way to get around that is to make a new local variable to use in the if statement. Since `f` isn't mutable, occurrence typing can work

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 editor — and every >> tool in

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

2016-08-24 Thread Alex Knauth
> On Aug 24, 2016, at 9:12 AM, Matthew Eric Bassett wrote: > > thank you for your reply, Alex. That was informative and helpful. > > On 08/19/2016 02:56 PM, Alex Knauth wrote: >> So to work around that, you can use `define-new-subtype` along with >> `unsafe-require

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

2016-08-24 Thread Alex Knauth
at 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 missing something. -- Y

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

2016-08-19 Thread Alex Knauth
pirit 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/untyped interactions. I

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 > wrote: > > On Wed, Aug 10, 2016 at 8:10 AM, Alex Knauth wrote: >>> I believe this fixes a bug in DrRacket but the way these handlers are >>> set up is pretty complicated. Here's an example program that beh

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

2016-08-10 Thread Alex Knauth
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 10, 20

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

2016-08-10 Thread Alex Knauth
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 received this message bec

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

2016-08-10 Thread Alex Knauth
137 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 better way

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

2016-08-09 Thread Alex Knauth
and kw-formals->required-kws and kw-formals->allowed-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

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

2016-07-28 Thread Alex Knauth
s 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 message because you ar

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

2016-07-28 Thread Alex Knauth
e` function from that. I'm not sure why it requires two newlines after input expressions though. Alex Knauth > Just out of curiosity, what would be the adequate "-I" syntax, if any? > (what I read in quote-bad/constructor-style-print/lang/runtime-config.rkt > is

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

2016-07-17 Thread Alex Knauth
hat 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 thi

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

2016-07-16 Thread Alex Knauth
> On Jul 16, 2016, at 7:18 PM, David Storrs wrote: > > Wow, that is a lot of problems. Thanks for taking the time to > comment; this was in large part an effort to learn macros, so it's > helpful to get this kind of feedback. > On Sat, Jul 16, 2016 at 2:48 PM, Alex K

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 'proc' would be something

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

2016-07-16 Thread Alex Knauth
:) Ok. Wait, even if you're using untyped racket, 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 "Ra

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

2016-07-15 Thread Alex Knauth
ther macros defined? How do things 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

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 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 into the namespace all immut

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

2016-07-14 Thread Alex Knauth
What's going on? Why isn'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 wrote: > > Would `syntax-debug-info` help here? Would t

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

2016-07-13 Thread Alex Knauth
? Would the `'bindings` option have the information I want? Alex Knauth > On Wed, Jul 13, 2016 at 6:32 PM, Alex Knauth wrote: >> >>> On Jul 13, 2016, at 7:25 PM, Robby Findler >>> wrote: >>> >>> You could define a language. Or you could do wh

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

2016-07-13 Thread Alex Knauth
cal context of the syntax object, if that's possible. Alex Knauth > On Wed, Jul 13, 2016 at 2:33 PM, Alex Knauth wrote: >> >>> On Jul 13, 2016, at 3:28 PM, Matthew Flatt wrote: >>> >>> At Wed, 13 Jul 2016 14:16:11 -0400, Alex Knauth wrote: >>>>

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 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? > > Instead of &

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 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 there a way to >>

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 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 bound and unbound identifier

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

2016-07-10 Thread Alex Knauth
d y are local variables (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-u

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

2016-07-01 Thread Alex Knauth
ntax/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! >> >

  1   2   3   >