Re: [racket-users] Wrong result from a define-syntax with pattern maching on a hash table

2020-07-06 Thread Sorawee Porncharoenwase
#lang scribble/manual @(require (only-in racket ~a)) @(define persons (list (hash 'name 'name1 'e-mail 'email1 'nickname 'nickname1) (hash 'name 'name2 'e

Re: [racket-users] Wrong result from a define-syntax with pattern maching on a hash table

2020-07-06 Thread Oualmakran Yassine
Sure. I would like to create a document with a repetitive structure in scribble. Let say I have something like this: @section{First section} Some text ... @subsection{First subsection} @itemlist... @section{Second section} Some text ... @subsection{Second subsection} @itemlist... etc. I would

Re: [racket-users] Wrong result from a define-syntax with pattern maching on a hash table

2020-07-06 Thread Sorawee Porncharoenwase
I still don't understand why you need to define a macro for that. We write macros to manipulate _code_ by transforming a syntax object into another syntax object. Extracting a value from a hash table or generating a text from hash tables has nothing to do with syntax objects. And it can be done wit

Re: [racket-users] Wrong result from a define-syntax with pattern maching on a hash table

2020-07-06 Thread Oualmakran Yassine
In fact, I would like to have a macro that will generate some text from a list of hash tables for scribble. So this macro is just a first step to try to achieve that (it's also the first time I try a non toy program in any Lisp). Le lundi 6 juillet 2020 20:04:27 UTC+9, Sorawee Porncharoenwase a

Re: [racket-users] Wrong result from a define-syntax with pattern maching on a hash table

2020-07-06 Thread Sorawee Porncharoenwase
What's wrong with `match`? It seems to be what you want. Macro is not going to help you here. On Mon, Jul 6, 2020 at 3:47 AM Oualmakran Yassine wrote: > Hello, > > I have some difficulties when trying to create a macro doing some pattern > matching on a hash-table and was hoping finding some h

[racket-users] Wrong result from a define-syntax with pattern maching on a hash table

2020-07-06 Thread Oualmakran Yassine
Hello, I have some difficulties when trying to create a macro doing some pattern matching on a hash-table and was hoping finding some help. The macro is taking a hash-table as parameter and I would like to extract the value for the key 'name. I did several trials of my macro with what should be,