On Fri, Feb 26, 2016 at 9:35 PM, Yichao Yu <yyc1...@gmail.com> wrote: > On Fri, Feb 26, 2016 at 9:34 PM, Ben Ward <axolotlfan9...@gmail.com> wrote: >> Ohhh I see it, yep. Can't give a number in a parametric type definition - >> ugh, well that's tiredness! > > Admittedly the macro expansion probably should have swallowed the error .....
And I obviously meant `shouldn't have` .... > >> >> >> On Saturday, February 27, 2016 at 2:12:43 AM UTC, Ben Ward wrote: >>> >>> Hi, >>> >>> I'm trying to create a macro for the BioJulia project which will allow >>> easy creation of biological alphabets, which will work with the new >>> BioSequence type we are designing as a major improvement to the Seq module. >>> As it will be creating types and functions, I expect hygiene will be an >>> issue, but before I even get to that, let's start simple. Just a quote, and >>> some interpolation: >>> >>> macro create_alphabet(alph_name, n_bits) >>> >>> >>> quote >>> >>> >>> immutable $(alph_name){$(n_bits)} <: Alphabet end >>> >>> >>> end >>> >>> >>> end >>> >>> >>> @create_alphabet (macro with 1 method) >>> >>> >>> julia> abstract Alphabet >>> >>> >>> julia> @create_alphabet hi 1 >>> >>> >>> ERROR: syntax: malformed expression >>> >>> >>> in eval(::Module, ::Any) at ./boot.jl:267 >>> >>> >>> >>> >>> For the life of me, I really cannot see what I've done wrong - it's one >>> line with two interpolated words! What massively obvious thing am I being a >>> moron about at 2 am? >>> >>> Thanks, >>> Ben.