11 Aug 2011 02:55:56 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (0 / 0 / 0)
- KwaliteeBus factor: 1
- License: apache_2_0
- Perl: v5.8.3
- Activity24 month
- Download (1.02MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:6 non-PAUSE usersCREAMYG Marvin Humphreyand 1 contributors
- The Apache Lucy Project <lucy-dev at incubator dot apache dot org>
Clownfish::Variable - A Clownfish variable.
A variable, having a Type, a micro_sym (i.e. name), an exposure, and optionally, a location in the global namespace hierarchy.
Variable objects which exist only within a local scope, e.g. those within parameter lists, do not need to know about class. In contrast, inert class vars, for example, need to know class information so that they can declare themselves properly.
my $var = Clownfish::Variable->new( parcel => 'Crustacean', type => $int32_t_type, # required micro_sym => 'average_lifespan', # required exposure => 'parcel', # default: 'local' class_name => "Crustacean::Lobster", # default: undef class_cnick => "Lobster", # default: undef );
type - A Clownfish::Type.
micro_sym - The variable's name, without any namespacing prefixes.
exposure - See Clownfish::Symbol.
class_name - See Clownfish::Symbol.
class_cnick - See Clownfish::Symbol.
# e.g. "int32_t average_lifespan" print $variable->local_c;
Returns a string with the Variable's C type and its
# e.g. "int32_t crust_Lobster_average_lifespan" print $variable->global_c;
Returns a string with the Variable's C type and its fully qualified name within the global namespace.
# e.g. "int32_t average_lifespan;" print $variable->local_declaration;
Returns C code appropriate for declaring the variable in a local scope, such as within a struct definition, or as an automatic variable within a C function.