On Wed, Aug 29, 2012 at 12:22 PM, John Benediktsson <mrj...@gmail.com> wrote:
> I just pushed a vocab with some ideas that might help you get started:
>
> USE: literate
>
> <LITERATE
>
> This is a section that is mostly text... you can even include "factor" stuff
> that doesn't get parsed like the following:
>
> : does-this-work? ( -- x ) "no it doesn't!" ;
>
> But, then if you want to run some code, you can do this:
>
>> : this-totally-works! ( -- x ) 12345 ;
>
> And then some more text, for fun...
>
> LITERATE>
>
> Try it and you'll see that the first definition is ignored, but the second
> is parsed:
>
>     IN: scratchpad \ does-this-work? see
>     No word named “does-this-work?” found in current vocabulary search path
>
>     IN: scratchpad \ this-totally-works! see
>     : this-totally-works! ( -- x ) 12345 ;
>
> Is something like this what you're looking for?

It would be cool to be able to extend the vocab loader with file
extension associations, each with a different default syntax and lexer
environment. `.factor` would of course be associated with the core
`syntax` and `lexer`, but you could then have for example `.lfactor`
files be searched for and loaded as if implicitly inside <LITERATE
LITERATE> tags. Other languages we've implemented as factor syntax
extensions, such as peg, infix, lisp, and smalltalk, could also have
top-level associations.

-Joe

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to