This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Yuki Kimoto
The switch
statement in SPVM language is a statement for conditional branch.
# switch statement
my $code = 2;
my $flag = 1;
switch ($code) {
case 1: {
print "1\n";
}
case 2: {
print "2\n";
}
case 3: {
if ($flag) {
break;
}
print "3\n";
}
case 4:
case 5:
{
print "4 or 5\n";
}
default: {
print "Other\n";
}
}
# switch statement using enumeration
class Foo {
enum {
ID1,
ID2,
ID3,
}
static method main : int () {
my $value = 1;
switch ($value) {
case Foo->ID1: {
print "1\n";
}
case Foo->ID2: {
print "2\n";
}
case Foo->ID3: {
if ($flag) {
break;
}
print "3\n";
}
default: {
print "Other\n";
}
}
}
}
How to install SPVM::Numpy
cpanm SPVM::Numpy
# Developper
cpanm SPVM;
git clone https://github.com/yuki-kimoto/SPVM-Numpy.git
See also Installing SPVM::Numpy
What Is SPVM?
SPVM is a static typed language that can be used from Perl. SPVM is the essential part of the Python/numpy porting to Perl. If you haven't heard of Perl's SPVM. Please see also SPVM Language Specification.
How potential dose SPVM have?
Growth is expected in the fields of Bio Tech, AI/ML, Apple/iPhone/iPad Apps, Google/Android Apps, IoT Device, Connected Car, Smart Device, Smart Home, etc.
This is because SPVM can produce an executable file that supports cross platforms and make easy to calculate arrays and bind C/C++ and Nvidia/GPU/cuda.
SPVM Documents
SPVM Modules
This project really needs contributors, sponsors, investors.
This project really needs contributors. I am looking for contributors, sponsors, investors.
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Yuki Kimoto
Yuki Kimoto | Sciencx (2022-11-13T23:15:03+00:00) The switch Statement – SPVM – The Project for Python/NumPy Porting to Perl. Retrieved from https://www.scien.cx/2022/11/13/the-switch-statement-spvm-the-project-for-python-numpy-porting-to-perl/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.