Re: Metaprogramming, mixed languages, and Vim.

2006-10-31 Thread Hugh Sasse
Here is what I ended up using, thanks to A.J.Mechelynck and A. S. Budden on the Vim list and Doug Kearns (what he called a bit of a '2 AM solution' -- and it works fine!) on the Vim-Ruby list. The first function highlights the %Q{} quotes in Ruby as C code, the second does it for here

Re: Metaprogramming, mixed languages, and Vim.

2006-10-27 Thread Hugh Sasse
On Thu, 26 Oct 2006, A.J.Mechelynck wrote: Hugh Sasse wrote: On Thu, 26 Oct 2006, A. S. Budden wrote: perl scripts embedded in a single Matlab script. I have done similar things for C and others. Well, in my .vimrc I now have: To MetaProgram C using Ruby function

Re: Metaprogramming, mixed languages, and Vim.

2006-10-27 Thread A.J.Mechelynck
Hugh Sasse wrote: On Thu, 26 Oct 2006, A.J.Mechelynck wrote: [...] Method III (recommended): include into your @CSTUFF cluster a file containing only the single line runtime! syntax/c.vim This would be equivalent (with fewer keystrokes) to Method II above. So all these will solve

Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
If one searches for code that writes code OR programs that write programs AND vim, one can turn up a number of references to this kind of activity. Dynamic languages are often more concise than those with static typing, and while I don't want to get into the debate on which is better, sometimes

Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Tim Chase
those with static typing, and while I don't want to get into the debate on which is better, sometimes it makes sense to use a dynamic language to generate code in a statically typed language. It's like asking whether a hammer or a screwdriver is better. Both are suited well to particular

Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
On Thu, 26 Oct 2006, Tim Chase wrote: those with static typing, and while I don't want to get into the debate on which is better, sometimes it makes sense to use a dynamic language to generate code in a statically typed language. It's like asking whether a hammer or a screwdriver is

Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread David S .
Hugh Sasse hgs at dmu.ac.uk writes: So, we run into a problem: how does one syntax highlight mixed language code? This works well for me, but needs delimters to indicate the appropriate syntax. http://www.vim.org/tips/tip.php?tip_id=856 So in my Python code, for example, I might have: ...

Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread A. S. Budden
On 26/10/06, Hugh Sasse [EMAIL PROTECTED] wrote: [snip] So, we run into a problem: how does one syntax highlight mixed language code? [snip] I don't know whether this is of any use, but I have often found situations where I need to embed code from one language in the comments of another. For

Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
On Thu, 26 Oct 2006, David S. wrote: Hugh Sasse hgs at dmu.ac.uk writes: So, we run into a problem: how does one syntax highlight mixed language code? This works well for me, but needs delimters to indicate the appropriate syntax. http://www.vim.org/tips/tip.php?tip_id=856 So

Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
On Thu, 26 Oct 2006, A. S. Budden wrote: On 26/10/06, Hugh Sasse [EMAIL PROTECTED] wrote: [snip] So, we run into a problem: how does one syntax highlight mixed language code? [snip] I don't know whether this is of any use, but I have often found situations where I need to embed code

Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread A.J.Mechelynck
Hugh Sasse wrote: On Thu, 26 Oct 2006, A. S. Budden wrote: On 26/10/06, Hugh Sasse [EMAIL PROTECTED] wrote: [snip] So, we run into a problem: how does one syntax highlight mixed language code? [snip] I don't know whether this is of any use, but I have often found situations where I need to