Hello all

Basically, as it stands Sprockets has two directives and a basic
system for macros.  Recently I've been developing a tool along the
same lines as Sprockets (I actually started last summer and was a
little annoyed when Sprockets came out, beating me to the punch, but
that's not really the point.  Within my system (yavascript) I have a
number of pre-processor directives and was looking to integrate them
with a more extensive version of Sprockets, or at least get some form
of input on future paths for Sprockets so my tool can be compatible
with possible future avenues.

Currently I have the following directives (hopefully all fairly
obvious in use)

#include - Unlike //= require, this is not limited to a single
inclusion.
#define - Similar to Sprocket's constants, but in the source itself,
also used more like C constants in not requiring the <%= %>
#if
#ifdef
#ifndef
#else
#endif
#undef

Currently I'm obviously using a different prefix but this was to avoid
confusion, if I started doing things like "//= undef" people may think
they were official Sprocket directives.  Anyway, that's the point of
this post, to see where people see Sprockets as going, even if not
soon.  It would be great if I could convert to an entire Sprocket
based syntax without fear of making up terms that are going to turn
out to be wrong (I'm already using 'include' as opposed to 'require',
but given that they have different functions (singular vs multiple
inclusion) this may not be a bad thing).

As for future directives, to get the ball rolling I would suggest:

//= require - As in Sprockets
//= provide - As in Sprockets
//= include - Require without restrictions on number of imports
//= if
//= else
//= end (or //= endif) - Conditional compilation (or conditional
inclusion) code

There could also be "//= ifdef" and "//= ifndef", but that can also be
done with "=== undefined" in Javascript.  As for defines personally I
prefer my/C's method as it allows for more modular definitions, rather
than grouping them, but clearly Sprocket's is better established.

Any thoughts on this would be greatly appreciated.  If I didn't make
myself very clear basically I was wondering if there were any plans
for future extensions to the Sprocket API so I could use them now, and
if not would it be possible to make some?

Thanks in advance

Alex "Y_Less" Cole

Note: This is a rehash of my post here: http://y-less.com/wordpress/?p=75
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to