Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scoped syntax grammars #10

Open
rurban opened this issue Feb 21, 2013 · 0 comments
Open

scoped syntax grammars #10

rurban opened this issue Feb 21, 2013 · 0 comments
Assignees
Milestone

Comments

@rurban
Copy link
Member

rurban commented Feb 21, 2013

potion blocks are closures with scoped mixins. so it's easy to override all methods in a scope, by switching to a new parser, eventually changed compiler rules and translate to p2 data.
The syntax need not to be dynamically loadable for this, indep of issue #11

{ use v6;
  # parse and run perl 6 code - ingy!
}
# back to p5

# ffi
my $num = 1.5;
{ use syntax 'C'; # load syntax-C
  #include <math.h>
  #pragma perl $num => double
  #pragma perl $result <= double n
  double n = sqrt(2.0 + $num);
}
say "sqrt(2+$num) => $result";

my $dbh = DBI->($data_source, $username, $auth);
my $t = 'sometable';
{ use syntax 'SQL' => $dbh;
  SELECT * FROM $t;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant