I'm trying to build a macro that will generate routing rules for
'dispatch-rules'.
(dispatch-rules) from web-server/dispatch has this form:
(dispatch-rules
(("announce-user") #:method post process-announce-user))
...more routes here...
)
This seems like it should be automatable, so I
Excellent thank you. To note I am searching the docs but I see I did not
scroll far enough. I went to go find string-prefix in the doc and also found
string-contains and string-suffix in the same set of examples.
So you gave me an inadvertent trifecta of useful information.
It also means
In a future version of what I am working on I see regex being an excellent
solution. My search is against a file I load into a list at program
initialization. However for other parts of this to load a list based on a
partial file filtered with regex may be a better solution.
There is also
To understand what's going on, consider the following program:
#lang at-exp racket
(define a "this")
(define (f . l)
(for-each displayln l))
@f{^@a}
which prints
^
this
What's going on is that the `{}` in at-exp notation will evaluate to a
list of strings. One
On Fri, Oct 28, 2016 at 3:24 PM, Ken MacKenzie wrote:
> In a future version of what I am working on I see regex being an excellent
> solution. My search is against a file I load into a list at program
> initialization. However for other parts of this to load a list based
When I made recent changes to my tzdata package, I included a module that
automates the process of re-building the package. (It downloads the latest
version of the tz data and its associated code, builds the zoneinfo
database from it, and constructs an info.rkt file for it.) I have a similar
kind
tl;dr : Why is the following an error?
#lang at-exp racket
(define a "this")
@pregexp{^@a} ;; Should produce #px"^this" but errors out
@pregexp{@(~a "^" a)} ;; This works but is clumsy
Long version:
The at-exp language
(http://www.greghendershott.com/2015/08/at-expressions.html and
Matthew Flatt [16-10-28 05:04]:
> If ARMBIAN and Raspbian are compatible, then you could try the Utah
> snapshot site's Raspbian build:
>
> http://www.cs.utah.edu/plt/snapshots/
>
> At Fri, 28 Oct 2016 03:21:49 +0200, meino.cra...@gmx.de wrote:
> > Hi,
> >
> > after
The `raco pkg config` options are documented here:
http://docs.racket-lang.org/pkg/cmdline.html#%28part._raco-pkg-config%29
(It might be a good idea to add the names of the individual options to
the index so they can be searchable.)
Specifically, the format is a series of username:password
> I just meant: it's an approach that has worked before. "Better"? That's for
> you to decide.
Alright :)
Regarding the syntax of the DSL, I was intentionally vague about it in the
original post because I wanted to focus on the technical choices I made. But let
me expand on it a bit the means of
I have two things I am trying to compare, both strings.
What I want to know is if string a is the beginning of string b.
Example (pseudo code)
string a = this
string b = that
string c = thisandthat
a... == c #t
b... == c #f
Hope I am making sense here. I couldn't figure out a way so at
Sort of. at a high level pseudo code view
I have a file of things
the user inputs a list of things
for each thing the user inputs it finds all reference in the file of things
To put it plainly if you are familiar with Princeton's word net db/files I
am searching the words in a user inputted
*@pregexp{^@a}* is read as *(pregexp "^" a)* [you can test this by
evaluating the quoted form, '*@pregexp{^@a}* ], but the function pregexp
expects a single string as its first argument (and, apparently, a function
or #f as its optional second argument).
More generally, the body part of an
Hi Meino,
I run Racket on my Raspberry Pi (version 2 and 3)[*]. I download unix
source + built packages and build the "core" following the instructions
in src/README:
https://github.com/racket/racket/blob/master/racket/src/README
Basically it's just:
mkdir build
cd build
../configure
make
make
Hi Ken,
string-prefix? does exactly what you want.
> (define a "this") (define b "that") (define c "thisandthat")
> (string-prefix? c a)
#t
> (string-prefix? c b)
#f
https://docs.racket-lang.org/reference/strings.html#%28def._%28%28lib._racket%2Fstring..rkt%29._string-prefix~3f%29%29
Best,
Is it possible to take (e.g.) a procedure object and decompose it back
into its original source code?
Background:
I need a very simple pure-Racket task manager for the app I'm working
on. This is an application-internal TM, not a for-users TM -- the
sort of tasks it will be handling are "in 5
>> 1) Perhaps have a look at the approach used by the `xml` and `html` and
>> `json`
>> libraries, which is 1) parse data from string, 2) store data in nested
>> structs, 3) generate new string from nested-struct thingy.
>
> I understand this approach, but I do not understand how it is better
Hi, all.
Greg Trzeciak: I did not know about Garden, thank you for the reference. In
particular, I liked the way he talks about decoupling selectors and
declarations. It is something I have been doing in my CSS for a long time:
previously with SASS mixins, now with my library and calls to Racket
18 matches
Mail list logo