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

2016-11-04 Thread Sam Tobin-Hochstadt
Here's an example: #lang racket (define (make-final-struct-type name count) (define-values (type constructor predicate accessor mutator) (make-struct-type name #f count 0)) (values (chaperone-struct-type type (λ _ (error 'fail1)) (λ _ (error 'fail2))

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

2016-11-04 Thread Sam Tobin-Hochstadt
Look at `chaperone-struct-type`: http://docs.racket-lang.org/reference/chaperones.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 wrote: > >> On Nov 4, 2016,

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: >> Hello, >> >> Is th

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

2016-11-04 Thread Sam Tobin-Hochstadt
Typed Racket chaperones the struct type to prevent further extension. Sam On Fri, Nov 4, 2016 at 4:29 PM, Alex Knauth wrote: > Hello, > > Is there a way to enforce that a particular struct is final, in other words, > that no one can declare a sub-struct of it? > > (struct foo (a b c) #:final) >

[racket-users] Declaring structs as final?

2016-11-04 Thread Alex Knauth
Hello, Is there a way to enforce that a particular struct is final, in other words, that no one can declare a sub-struct of it? (struct foo (a b c) #:final) (struct bar foo (d e f)) ; should produce a syntax error similar to: ; struct: cannot inherit from the final struct foo (make-struct-type

Re: [racket-users] Extending DrRacket's LaTeX Shortcuts

2016-11-04 Thread Vincent St-Amour
Hi Kelly, The table's source is there: https://github.com/racket/gui/blob/master/tex-table/tex-table.rkt It doesn't look like the list is user-extensible, but you can extend it by modifying the file. To do so, you'd want to update the `tex-table` package to use a from-source version (from t

[racket-users] Extending DrRacket's LaTeX Shortcuts

2016-11-04 Thread Kelly Smith
I've been learning Racket for awhile now (it's the first language I've seriously pursued), and I can usually fumble together what I need for small projects. However, lately I've been working with Pollen, and my documents call for a lot of math symbols. I'm wondering if there's a reasonable way t

Re: [racket-users] The regex and me...

2016-11-04 Thread Jens Axel Søgaard
The first result string is the first matched string. The second result is what was matched by the sub expression in the parenthesis. > Den 4. nov. 2016 kl. 20.04 skrev meino.cra...@gmx.de: > > Hi, > > Normally I would tend to think, that I am > quite familiar with regex and their usage > (bac

[racket-users] The regex and me...

2016-11-04 Thread Meino . Cramer
Hi, Normally I would tend to think, that I am quite familiar with regex and their usage (background: UNIX?Linux, sed, vi/vim, Perl...) Then I played a little with regex-match...and I have to go to school again..,, >From the Racket guide: > (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;"

Re: [racket-users] Re: How "expensive" are regular expression in Racket in general?

2016-11-04 Thread Meino . Cramer
Hi George, thanks for your reply! :) I know Perl and its regexp quite well...so I will go for the regexified solution first. But...I fear I have to sort my brain first. I played around a little with regex-match and friends...and often I dont understand the results... Cheers Meino George Neu

Re: [racket-users] How "expensive" are regular expression in Racket in general?

2016-11-04 Thread Robby Findler
There really isn't a better way. Robby On Friday, November 4, 2016, wrote: > > Hi David, > > thanks for your reply! :) > > ...unfortunatelu this wpuld imply to implement both solution > correctly and compare them. > I asked here on the mailinglist fpr the better solution just > to avoid that...

Re: [racket-users] How "expensive" are regular expression in Racket in general?

2016-11-04 Thread Meino . Cramer
Hi David, thanks for your reply! :) ...unfortunatelu this wpuld imply to implement both solution correctly and compare them. I asked here on the mailinglist fpr the better solution just to avoid that... ;) Cheers Meino David Storrs [16-11-04 17:36]: > That's a good question -- I don't know

[racket-users] Re: How "expensive" are regular expression in Racket in general?

2016-11-04 Thread George Neuner
On Fri, 4 Nov 2016 04:03:53 +0100, meino.cra...@gmx.de wrote: >I have to break down input from textfiles in lists. Due to >missing formatting symbols like ";" (csv) I have do it more >"analogous". ;) > >It can be done by regex and it can be done by line splitting, >procesing the results (removing