On Saturday, July 16, 2016 at 7:06:10 PM UTC-4, David K. Storrs wrote:
> So, if one should prefer functions, what is a good place to use
> macros? When people talk about why LISP/Scheme/Racket are the most
> powerful languages, they inevitably mention macros and continuations.
> What is a good use
I see. Okay, thanks for clarifying.
On Sat, Jul 16, 2016 at 8:05 PM, Alex Knauth wrote:
>
>> 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
> 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 Knauth wrote:
>> A few pro
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 Knauth wrote:
>
>> On Jul 16, 2016, at 2:16 PM, David Storrs wrote:
>>
>> I'm trying to w
On Sat, Jul 16, 2016 at 2:48 PM, William J. Bowman
wrote:
> To address the immediate problem, this `procedure?` test will always return
> `#f`, since `#'pred` is a
> syntax object and not a procedure. You need to do `(procedure? (syntax->datum
> #'pred))`. Similarly
> reasoning applies to the `
On Sat, Jul 16, 2016 at 2:48 PM, Alexis King wrote:
> Of course, this makes sense, given that macros operate entirely at
> compile-time. What you really want here is a function, not a macro. You
> can write a simple function that will accept a procedure or a string and
> will produce a procedure:
> 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
On Sat, Jul 16, 2016 at 02:16:20PM -0400, David Storrs wrote:
> I saw the #:when keyword for patterns and thought that would do what I
> needed. The following code seems like it should work, but it doesn't.
> What am I missing?
>
>
> (define-syntax (throws stx)
> (syntax-parse stx
>
I don’t think you want to use a macro to do this.
You could detect, at compile-time, whether or not the provided argument
is a string within the macro. The best way to do this would probably be
to use the “str” syntax class, which detects strings within a
syntax-parse pattern. However, this has a
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 like exn:fail? and 'string' would be
matched against the message insid
10 matches
Mail list logo