Skip to content
Snippets Groups Projects
  • xo30xoqa's avatar
    ab698d68
    Rewrote @species · ab698d68
    xo30xoqa authored
    The first version generally did what it was supposed to, but was overly
    complicated and brittle, because it basically did its own parsing.
    This version simply wraps the user code in a function and uses @locals
    to access the ready-parsed variables. This is not only much cleaner,
    but also gives the user more of what he expects (e.g. the ability to
    reference previously defined variables).
    
    I had actually tried this approach before, but only got it to work
    once I understood how @locals works under the hood, plus a lot of other
    Julia internals. So I now not only have more elegant code, I also
    learnt quite a bit - a good win :-)
    ab698d68
    History
    Rewrote @species
    xo30xoqa authored
    The first version generally did what it was supposed to, but was overly
    complicated and brittle, because it basically did its own parsing.
    This version simply wraps the user code in a function and uses @locals
    to access the ready-parsed variables. This is not only much cleaner,
    but also gives the user more of what he expects (e.g. the ability to
    reference previously defined variables).
    
    I had actually tried this approach before, but only got it to work
    once I understood how @locals works under the hood, plus a lot of other
    Julia internals. So I now not only have more elegant code, I also
    learnt quite a bit - a good win :-)
Code owners