Questions tagged [defmacro]
5 questions
5
votes
3 answers
Why don't we write haskell in LISP syntax? (we can!)
It... kinda works you guys (This absolutely compiles, adapted from https://hackage.haskell.org/package/scotty):
main :: IO ()
main = (do
(putStrLn "Starting Server....")
(scotty 3000 (do
(get "/hello/:name"
(text ("hello " <> (param…

0atman
- 3,298
- 4
- 30
- 46
3
votes
1 answer
Correct way to incorporate a docstring in a def* macro?
I am working my way through Practical Common Lisp. I got to the example where you define a deftest macro that works like defun with some added functionality. This got me thinking that it would be nice to be able to add a docstring. I have found that…

bashfuloctopus
- 348
- 3
- 13
0
votes
2 answers
SBCL Type Inference problem in a somewhat weird macro
I'm trying to create a shorthand for lambda using underbar (_), per:
(defmacro _ (&rest body)
`(lambda (&rest…

jackisquizzical
- 307
- 1
- 8
0
votes
1 answer
Scala 2 macro type class derivation for `Coder[P <: Product]` ends with error `P does not take parameters`
I am a starter with Scala 2 Macros (before I switch to Dotty) who after trying out the shapeless type class derivation wanted to go one step beyond and write a macro that can generate a type class instances for any scala.Product without it.
(for the…

fpopic
- 1,756
- 3
- 28
- 40
0
votes
3 answers
Common Lisp Macro to expand an argument list passed as rest like: (foo (expand bar 100 200 300)) => (foo (bar 100) (bar 200) (bar 300))
Sorry for the clumsy title but i'm having a hard time describing what i'm looking for in a few words ...
I'm working on a Common Lisp DSL project and I'm wondering if the following is possible:
The DSL might have a couple of functions
(defun foo…

EllipsenPark
- 127
- 9