The 5th Republican debate is underway, and most of the candidates that can remember what encryption is appear to be "against" it. Rewatch the first hour for some truly chilling comments. Only Ted Cruz or Rand Paul appear to deviate from the party line on security, and not that much in the case of Cruz.
Undermining these peoples' fantasies and law enforcement in general should be a top priority for our community.
In former (?) actor Shia LaBeouf's latest performance art stunt, he will be taking calls at a mini call center:
The Hollywood star has set up his own call centre in the city's Fact gallery, where he and his two artistic collaborators will field calls.
They will be at their desks between 11:00 and 18:00 GMT from Thursday to Sunday.
Those wishing to touch LaBeouf's soul can call the trio on 0151 808 0771.
Others can visit the gallery to see the event unfold in person, or can watch a live stream and see notes the trio are making on Touchmysoul.net.
Get in touch.
http://www.bbc.com/cymrufyw/34985536
https://www.flickr.com/photos/126915334@N03/ (higher resolution, watermarked)
From Obama's prime time speech:
This is our strategy to destroy ISIL. It is designed and supported by our military commanders and counterterrorism experts, together with 65 countries that have joined an American-led coalition. And we constantly examine our strategy to determine when additional steps are needed to get the job done.
That's why I've ordered the Departments of State and Homeland Security to review the visa waiver program under which the female terrorist in San Bernardino originally came to this country. And that's why I will urge high-tech and law enforcement leaders to make it harder for terrorists to use technology to escape from justice.
It sounds like Obama may be taking a U-turn. The Second Crypto War isn't over yet.
Canadian Liquor Stores Want You to Be Able to Buy Weed with Your Six Pack
Liquor stores in British Columbia and Ontario want to start selling weed once it becomes legal in Canada.
The two unions representing BC's public and private liquor stores announced a partnership this week—the Responsible Marijuana Retail Alliance of BC—through which they're advocating to sell recreational pot at retail locations by next Christmas.
Their logic seems to be that liquor stores already sell a controlled substance that gets people fucked up, so adding weed to their mix just makes sense.
"Just as with alcohol, there are legitimate concerns about access to marijuana by youths. Our stores are an over-19, age-controlled environment and our industry has demonstrated the strongest compliance with identification checks," said Stephanie Smith, president of the BC Government and Service Employees' Union, which represents the province's 200 public liquor stores.
It would also be cost effective. Because liquor stores already have a warehousing and retail system in place "there is no need to reinvent the wheel," she said.
Last month, Warren "Smokey" Thomas, head of the Ontario Public Service Employees Union, which represents LCBO employees, said LCBO outlets would be ideal weed retailers because they already have "social responsibility" covered.
"They do age checks, they do refusals if somebody's intoxicated."
[...]
It took a few decades, but they came around to accepting a tenuous reinterpretation of the Second Amendment.
Rising up to the bait, I asked why and was pointed to three legal essays (labeled by authors Burton Newman, Anthony M. Sierzega (PDF of a project for undergraduate honors), and Saul Cornell). This rant is going to discuss the basic problems I noticed right away.
All these essays argue that the Second Amendment grants a collective right rather than an individual right, and that the "individual right" was a relatively new spin peddled in recent decades by the NRA and the libertarian movement.
The first thing I noticed was that two of the three essays ignored the actual writing of the Second Amendment.
A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed.
It seems kind of a huge oversight to ignore that the Amendment grants a right to "the people" (which has always been interpreted to mean anyone living in the US, not just US citizens) and then turn around and say that the right is clearly "collective". Is the previous amendment on free speech "collective" as well? For example, Newman writes:
In 1939 the Supreme Court issued the Miller decision. The justices ruled that "the Second Amendment must be interpreted and applied with the view of its purpose of rendering effective Militia." That was the state of Second Amendment law until the 2008 Heller decision. Prior to Heller, the Supreme Court never recognized that individuals had an individual right to keep and bear arms. It was the NRA propaganda, not the law of the land, that led the cry for unlimited gun ownership and protection of gun owner rights. The NRA myths allowed the cycle of expanded gun sales and NRA power to purchase political influence. Democrats and Republican alike announced their allegiance to the Second Amendment and the public grew to believe that the NRA view of the Second Amendment was consistent with constitutional law. The NRA controlled too many elected officials to allow for protection of our citizens from gun violence, gun deaths and unspeakable gun horrors in schools and public places.
Meanwhile Cornell writes:
The Second Amendment reads: "A well regulated militia, being necessary to the security of a free state, the right of the people to keep and bear arms, shall not be infringed." What do these words mean? Well, the answer to this question depends on who you ask. Supporters of the so-called collective rights interpretation believe that the Second Amendment only protects the right to bear arms within the context of well regulated militias. Supporters of the so-called "individual right" interpretation view the right to bear arms as a right vested in individuals, much like the 1st Amendment right to freedom of speech.
The fact that there are two such divergent interpretations is the result of significant changes in how Americans view the 2nd Amendment that occurred during the latter part of the twentieth century. For most of the last century, the meaning of the Second Amendment was not particularly controversial: the courts, legal scholars, politicians, and historians endorsed some version of the collective rights interpretation. As late as 1991, Chief Justice Warren Burger described the individual rights view as an intellectual fraud. Yet, the growth of a revisionist individual rights theory of the Second Amendment in the years since Burger made his comment has been nothing short of astonishing.
This view was originally propagated by gun rights activists such as Stephen Halbrook, Don Kates, and David Kopel whose research was funded by libertarian think tanks and the National Rifle Association (NRA).
It's only Sierzega's essay that observes (via discussion of a legal opinion written by current Justice Antonin Scalia) that "the people" elsewhere in the Constitution (including amendments) referred to individual rights.
Next, Scalia turns to the language of the Second Amendment, once again arguing along the same lines as the libertarian individualists. He begins his analysis by dividing the amendment into two clauses: the prefatory clause (“A well regulated militia, being necessary to the security of a free State”), and the operative clause (“the right of the people to keep and bear Arms, shall not be infringed”). Scalia believes the prefatory clause simply announces the purpose of the Amendment and does not limit the operative clause (District of Columbia v. Heller 2008, 3). He writes that while “this structure…is unique in our Constitution, other legal documents of the founding era, particularly individual-rights provisions of state constitutions, commonly included a prefatory statement of purpose” (District of Columbia v. Heller 2008, 3). For Scalia, the prefatory clause may offer clarification regarding the operative clause, but it in no way restricts its meaning. After defining several key phrases found in both clauses, Scalia offers a conclusion regarding the meaning of the structure of the amendment.
Scalia begins his analysis of the operative clause with an examination of the phrase “the right of the people.” The Bill of Rights uses the phrase three times: in the First Amendment’s Assembly-and-Petition Clause, in the Fourth Amendment’s Search-and-Seizure Clause, and in an analogous phrase in the Ninth Amendment (District of Columbia v. Heller 2008, 5). According to Scalia, each of these examples refers to the protection of an individual right, not a collective right. The use of the words “the people” by themselves is found three additional times in the Constitution, each regarding the reservation of power, not rights (District of Columbia v. Heller 2008, 6). The phrase “right of the people,” when used in its entirety, always refers to an individual right. “The people” used in these six examples has been read to describe the entire political community. Therefore, according to Scalia, the amendment does not just protect a subset of people, in this case the militia consisting of adult white males. Instead, it protects the rights of all Americans.
Seems strange to me that legal opinions would ignore an obvious interpretation of the amendment and instead go to great effort to portray the "individual right" interpretation as something novel.
There is also a remarkable glossing over of history. Once again, Sierzega is the only one to observe that the NRA's lobbying efforts started in 1934 not 1977 (when every one of the essays claims the NRA was taken over by "libertarians"). Further, he's the only one to observe that federal level gun control started in 1934 with the National Firearms Act as well with regulations presented by then President Franklin D. Roosevelt (FDR) to restrict firearms which were commonly used by criminals of the day (such as bans on sawed off shotguns and silencers, and restrictions on machine guns). This law and similar ones of the day were, according to Sierzega, contributed to and supported by the NRA, whose leadership expressed support for the "collective right" model for the Second Amendment.
Even more surprisingly, the early NRA supported, and often helped write, many of the nation’s first federal gun control laws, including the 1934 National Firearms Act and the 1938 Gun Control Act (Rosenfield 2013). Testifying before Congress in 1938, NRA President Karl T. Frederick supported the National Firearms Act, stating that “I have never believed in the general practice of carrying weapons. I do not believe in the general promiscuous toting of guns. I think it should be sharply restricted and only under licenses” (Rosenfield 2013).
But on the other hand, it is quite clear that the NRA supported individual ownership of firearms and use of firearms for numerous purposes, particularly, hunting, self defense, and sporting/target practice. In other words, despite their public statements, they clearly have supported individual rights such as ownership and use of firearms since their very beginning in 1871 and immediately started to lobby to protect those rights from the moment that they were threatened at the federal level.
This leads to an issue of timing which was wholly ignored by these essays and Mr. AC, namely, that the distinction between individual and collective right was completely irrelevant to federal level gun control until 1934. So the alleged "revisionism" covers a bit over four decades before 1977 rather than almost two hundred years. It's been almost as long since 1977, the year that the NRA started explicitly supporting individual rights. The fact that US Congress didn't even see fit to regulate firearms till 1934 also indicates to me substantial implicit support for individual firearm rights.
The Supreme Court ruling which decreed a "individual right" was District of Columbia v. Heller. In 1976, Washington, DC in response to one of the worst crime rates in the US, passed a gun control law that severely impaired peoples' ability to protect themselves with firearms. Aside from firearms grandfathered in from before 1976, handguns were banned and all firearms had to be stored in a way that made them much harder to prepare for self defense on sudden notice. Newman's essay glosses over this harm and I doubt, for example, that the Supreme Court of the 19th century would backed such a law no matter how they choose to interpret it. The interpretation of an individual right is natural here because the situations of self defense are naturally individual. There is no collective right to self defense. And it was quite clear that the ability to not only bear firearms, but to be able to use those firearms instantly was crucial to a variety of self defense scenarios (such as a resident reacting to a nearby burglar).
Coincidentally, this law barely predates the alleged libertarian takeover of the NRA. It'll be interesting to see how much influence it had on the NRA power shift.
The last point I want to make here is that a collective right is rather dubious legal structure on moral and practical grounds. For example, the most common use of the expressly collective right was to give some classes of people advantages over other classes of people (eg, apartheid in South Africa). And it is dubious to claim you have a collective right without a corresponding individual right. For example, how could we have a collective right to free speech, if no individual also had that right? Eg, the US public could say whatever it wanted by say, a poll, but no one individually could? That would go wrong immediately.
Similarly, what is the point of a collective right to bear arms? As a counter to US military might, it's a joke. All of the states' National Guards forces are no match for the US military assuming they were even independent enough to fight the US military (say because the US military declines to provide them with weaponry and supplies). Nor does existence of the National Guard help the average citizen becoming a better soldier in an "effective Militia" (as described by the Supreme Court in the Miller decision above). OTOH, the individual right to own and use firearms does just that. It creates a huge group of people familiar with the care and use of firearms which would be necessary to any "effective militia" and it supports the above mentioned individual right to self defense.
And of course, all the essays had to mention former Chief Justice Warren Burger's opinion (here from Newman):
In a PBS News Hour interview in 1991, former Supreme Court Chief Justice Warren Burger referred to the NRA Second Amendment myth as "one of the greatest pieces of fraud, I repeat the word fraud, on the American people by any special interest group that I have ever seen in my lifetime."
In sum, I find these peculiar essays (which may not reflect mainstream gun control advocacy) to have contained considerable hypocrisy with a bunch of revisionists complaining about other alleged revisionists and claiming "fraud" over an obvious interpretation of the Second Amendment and obvious historical support for it. Further, actual history shows no significant gun control regulation for 140 years after the US ratified the Bill of Rights with crudely two bouts of federal level gun regulation, the first in the 1930s and the second starting in the 1970s. Currently, we have what appears to me to be a near reversal of gun control regulation to the level prior to the 1970s with what appears to be a great deal of public support both for the reversal and for the individual rights interpretation of the Second Amendment.
So, Amazon ordered 9 episodes of Man in the High Castle on 2015-02-18 ... those episodes were released on 2015-11-20. That's 275 days for a season of this show to be produced, apparently, consisting of 9 episodes. 30 5/9 days per episode. That comes to 306 days for another 10 episodes. So if they announced a season 2 today, we might see another season on October 3 of next year.
Rats.
This is a continuation of Perl 6 is way more Perl than Perl 5.
At some point I'll have to stop thinking of Roles and Traits as something I can do with Moose and start thinking of them as things that Perl 6 invented in the first place. That means Perl 6 isn't Moose on crack; Moose is Perl 6 sleep walking on Ambien. Moose did faithfully recreate the features and there are syntax differences between Moose and Perl 6 that matter little. However Moose has limited ways it can be implemented inside Perl 5 and so far Perl 6 gets this better.
I'm not quite sure how to explain what a role is for those who are unfamiliar with Modern Perl in any way. For reference the documentation for Perl 6 roles is at http://doc.perl6.org/language/objects#Roles and the Moose version is at http://search.cpan.org/~ether/Moose-2.1604/lib/Moose/Manual/Roles.pod but I'll try to do a quick summary here. Classes are concrete definitions of code and variables as in all models of OO I'm aware of. Roles also define code and variables but also can define interfaces/contracts by specifying things their implementation expects. Roles are applied to classes and the resources from the role are mixed into the class instead of coming in through an inheritance hierarchy. As roles are applied conflicts can be resolved manually through selective application of resources inside a role by the programmer or automatically by the language runtime. Because a role is mixed into a class the classes can still do all their normal class things including multiple inheritance if you really want it.
Another thing roles do is exist, have a name, and objects happily wear them like a badge of honor through meta-programming. Because roles define interfaces and objects let you know about their roles it is easy to find objects that implement the interfaces of a role if you know where to look for candidate objects. Because meta-programming lets you program the language from the language you can also apply roles at runtime at objects that never saw it comming. Because Perl 6 is highly regular everything is an object. Repeat: everything is an object.
Just how everything is an object is Perl 6? Instances of a class are objects, Classes are objects, Variables are objects, Attributes (class variables) are objects, Methods are objects, Functions are objects, and for all of those objects there are meta-objects that are objects that describe them. Unlike other languages there is no boxing of primative types so immediate values (or what ever a value is declared directly in source code is called) are objects too.
What does that even mean? You can apply a role to any of them! When applying a role to something like a function or attribute it typically changes the meta-objects in either subtle or drastic ways. For instance an attribute in a class is by default a mutable variable in private context but exposes an immutable variable through the public interface. Through application of a role to the attribute the meta-object is updated and the behavior is changed. That means Perl 6 uses roles for its own implementation; Perl 6 is extremely recursive like this and I think it is rather neat.
Traits are shortcuts for application of roles. Changing the mutability of an attribute in a class is done through the 'rw' trait while the 'ro' trait gets applied by default. For a class with one public scalar attribute it looks like this:
class Nope {
#has declares a new attribute
#$ defines the variable as being scalar (holds single thing)
#. defines the attribute as being public
has $.goodies;
}
class Yep {
has $.goodies is rw;
}
my $ro = Nope.new;
my $rw = Yep.new;
$rw.goodies = "I drank your milkshake!";
say "Stored in rw: ", $rw.goodies;
$ro.goodies = "Little pig, Little pig, Let me in!";
say "Stored in ro: ", $ro.goodies;
And when executed gives the following output:
bash> perl6 journal.p6
Stored: I drank your milkshake!
Cannot modify an immutable Any
in block <unit> at journal.p6:15
Roles and traits can be used by programmers to reduce the typing required by users of the interfaces that objects expose. In my proof of concept project described in Perl 6 is way more Perl than Perl 5 I'm looking for a way to mark object attributes and a method as being locations for storing input and output data and a way to perform operations on those pieces of data. There I used traits to apply roles to attributes and methods and update the meta-objects to provide methods for finding those attributes and methods. The exposed interface works out pretty well when creating a class that fits the model:
use v6;
#This brings in the Baller::Object role, supporting roles, and the
#inport, outport, and callpoint traits
use Baller::Object;
#does applies the Baller::Object role to the class
class Math::Add does Baller::Object {
#The attributes have a type defined. A Cool is anything that can
#act like a number or a string. They are like a Perl 5 scalar.
has Cool $.arg1 is inport;
has Cool $.arg2 is inport;
has Cool $.result is outport;
method calculate is callpoint {
$!result = $.arg1 + $.arg2;
}
}
Using the meta-object protocol it is easy to find the call point (or the ports) for an object:
my $thing = Math::Add.new(arg1 => 2, arg2 => 2);
say $thing.^methods.grep({ $_ ~~ Baller::Object::CallPoint });
Which provides a textual representation of a list of methods that do the role that is applied through the callpoint trait:
(calculate)
Working with the ports is easy too:
say $thing.^attributes.grep({ $_ ~~ Baller::Object::InPort });
(Cool $!arg1 Cool $!arg2)
say $thing.^attributes.grep({ $_ ~~ Baller::Object::Port });
(Cool $!arg1 Cool $!arg2 Cool $!result)
So is finding and invoking the callpoint method in object context:
#The array is typed and can only store objects that implement the CallPoint role
my Baller::Object::CallPoint @points = $thing.^methods.grep({ $_ ~~ Baller::Object::CallPoint });
#Because I don't really know what I'm doing yet
my $point = @points[0];
say "Output defined before invocation: ", $thing.result.defined;
#Invoke the discovered method in object context
$thing.$point;
say "Output defined after invocation: ", $thing.result.defined;
say $thing.arg1, " + ", $thing.arg2, " = ", $thing.result;
------
Output defined before invocation: False
Output defined after invocation: True
2 + 2 = 4
This exposed clean API is not with out cost though: the source code that implements the Baller::Object role has some cat barfing on a keyboard qualities.
use v6;
unit module Baller::Object;
use Baller::Node;
role Baller::Object::Port {
}
role Baller::Object::InPort does Baller::Object::Port {
}
role Baller::Object::OutPort does Baller::Object::Port {
has Baller::Edge @.edges;
}
role Baller::Object::CallPoint {
say "applying callpoint role";
}
role Baller::Object does Baller::Node {
multi sub trait_mod:<is>(Attribute:D $attr, :$inport!) is export(:DEFAULT, :traits) {
say "'inport' trait invoked: ", $attr.^name;
say "args: ", $inport;
say "args type: ", $inport.WHAT;
$attr does Baller::Object::InPort;
$attr.set_rw;
}
multi sub trait_mod:<is>(Attribute:D $attr, :$outport!) is export(:DEFAULT, :traits) {
say "'outport' trait invoked: ", $attr.^name;
say "args: ", $outport;
$attr does Baller::Object::OutPort;
}
multi sub trait_mod:<is>(Routine $r, :$callpoint!) is export(:DEFAULT, :traits) {
say "'callpoint' trait invoked: ", $r.^name;
say "args: ", $callpoint;
$r does Baller::Object::CallPoint;
}
#FIXME how can/should this be moved into a meta class?
method inports {
return self.^attributes.grep({ $_ ~~ Baller::Object::InPort });
}
method inport(Str $name is required) {
my $attribute_name = "\$!$name";
my @found = self.inports.grep({ .name eq $attribute_name });
if (@found.elems != 1) {
die "there must be only 1 result for '$name', got: ", @found;
}
return @found[0];
}
#FIXME how can/should this be moved into a meta class?
method outports {
return self.^attributes.grep({ $_ ~~ Baller::Object::OutPort });
}
method outport(Str $name is required) {
my $attribute_name = "\$!$name";
my @found = self.outports.grep({ .name eq $attribute_name });
if (@found.elems != 1) {
die "there must be only 1 result, got: ", @found;
}
return @found[0];
}
#FIXME how can/should this be moved into a meta class?
method callpoint {
my @points = self.^methods.grep({ $_ ~~ Baller::Object::CallPoint });
if (@points.elems != 1) {
die "only 1 entrypoint for an object is allowed; found: ", @points;
}
return @points[0];
}
}
The benefit of Perl 6 is that I was able to put together enough end user API that it exposed an issue with my most fundamental and basic model that will be in use in my project. For all the good and bad this is pretty bad-ass.
I've been writing Perl 5 since 1995. I remember when Perl 6 was announced, I remember when Moose back ported the concepts from Perl 6 to Perl 5, and when Moo recreated Moose but allowed the Perl interpreter to start in less than a second. I can read Perl 5 that looks line noise though I very much dislike it. I spent my first 5 years writing Perl that was very much like garbage collected C then I picked up the more advanced features later. I tend to write clear and easy to understand code erroring on the side of being more verbose than necessary.
I've always kept a distant watch on Perl 6 while the development went through several implementations of the language. I started paying a little bit closer attention when Rakudo started shipping the Star releases. I started paying attention and hitting the documentation when rumor was spreading that a 1.0 release is near. I was elated when Larry Wall announced the majority of the work left to release Perl 6 1.0 is to fix the bugs people might mistake for features. Some time around Christmas 2015 the real Perl 6.0 will stand up.
The most recent release of the Perl 6 language is only a few months old and is pretty good. It is not completely polished but it certainly is letting me get a bunch of experimentation done. I just spent the day swimming around in attributes, Cools, accessors, Roles and partial documentation. At this point I've decided it is time to put some faith into Perl 6 and start using it so that in a few years when it is quite refined I'll already be seasoned at using it.
My thoughts after a solid day of doing something rather serious:
The project I'm working on is a proof of concept for implementing dataflow based computation. I really like dataflow and the application to event driven systems is very clean. I've never been particularly fond of any of the event handling frameworks and have tried a few times to create my own; never were the results very good or better than anything else available. Now I've got more experience under my belt though and I've decided to give it another shot while letting the language features of Perl 6 reduce my typing. This morning I started with some notes I've refined over the past few weeks:
Baller proof of concept: synchronous dataflow directed graph that adds numbers
from one source to a constant value and outputs the sum of both numbers to stdout.
dataflow: Computation is performed through a network of objects that pass
data between each other. The program behavior is controlled through
the object types and their connections.
directed graph: Each object is represented as a node in a graph. Objects must have
at least 1 input or output for data but may have more than 1 of each.
The inputs and outputs of each object are called the object registers.
Edges connect output registers to input registers so there is always
a single direction that data travels between two nodes.
synchronous: All objects in the graph must execute once, in data dependency order,
on each cycle of the graph. An object may only execute if the
input registers have defined values. The entry point for execution of
a graph for a single cycle is each node that has no connected input
registers (or no input registers at all) and each of those nodes must
be ready at the start of the cycle. As each node is executed the output
registers will be updated, values propagate to the input registers of
dependent nodes, those nodes become ready, and execution continues. If
execution of a single cycle can not happen because no more ready nodes
exist it is a fatal error unless the cycle has completed.
For an example of an existing real world system that uses a combination of graphical
modeling and dataflow based computation there is Scicos.
* http://www.scicos.org/img/demos/SystemObserver.png
* http://www.scicos.org/
See Also
* Kahn process networks
* Petri nets
* Flow-based programming
<graph mode="synchronous">
<!-- SawStream has one output register named 'result' which on every
cycle of the graph will have a single integer value that ranges from
0 to 9 and wraps back to 0 again in a loop forever -->
<node class="SawStream" id="stream"/>
<!-- Math::Add is configured to have 2 numerical input registers named
'arg1' and 'arg2' and a single output register named 'result' with
the sum of both args; on each cycle the node performs the addition
operation using the current values of the input registers. -->
<node type="Math::Add" id="op">
<conf inputs="2"/>
<!-- define a constant value for input register number 2 -->
<register name="arg2" constant="true">1</register>
</node>
<!-- STDOUT has a single input register named line and any data in there
is sent as a string to stdout followed by a new line then the register
is reset to empty again. If there is no data available in the input register
the node will not be ready.
<node type="STDOUT" id="display"/>
<!-- the output of the SawStream node goes to one of the inputs of the math
node; op.arg2 is a constant value and will be used every time the add operation
is performed -->
<edge in="stream.result" out="op.arg1"/>
<!-- the output of the math block becomes the input of the STDOUT block
<edge in="op.result" out="display.line">
</graph>
Executing the graph for 10 cycles would produce the following output:
1
2
3
4
5
6
7
8
9
10
* The SawStream generated a sequence of values: 0 1 2 3 4 5 6 7 8 9
* The math node adds the value of the SawStream output register for this current
cycle to the constant value of 1 in the register named arg2.
* The output of the math operation is then used by the STDOUT object to print the
numerical value as a string.
And by the end of the day I had this code driving a minimal implementation of a dataflow engine:
use v6;
use Baller::Object;
class Math::Add does Baller::Object {
has Cool $.arg1 is input[required => 1];
has Cool $.arg2 is input[required => 1];
has Cool $.result is output;
method calculate is callpoint {
$!result = $.arg1 + $.arg2;
}
}
class StandardOut does Baller::Object {
#Should the methods for implementation for the behavior go into the object in this variable
#or should it go into the meta class? Inquiring minds have no idea what is a bad idea.
#
#The value in the register is reset on each cycle of this object and the value
#must be defined for the object to be ready. The variable does not have to be defined
#during construction though so is required does not appear to be correct.
has Cool $.line is input[reset => 1];
#can 'say' be imported from the perl6 implementation so the trait is the only required
#part of the implementation?
method say is callpoint {
say $.line;
}
}
class SawStream does Baller::Object {
has Int $.current = 0;
has Int $.result is output = 0;
method next is callpoint {
$!result = $.current;
$!current++;
if ($.current > 9) {
$!current = 0;
}
}
}
say "Done with init. Doing stuffs.";
say "";
my $numbers = SawStream.new;
my $display = StandardOut.new;
my $op = Math::Add.new(arg2 => 1);
baller_connect($numbers, 'result', $op, 'arg1');
baller_connect($op, 'result', $display, 'line');
for 1.. 25 {
baller_call($numbers);
baller_call($op);
baller_call($display);
}
sub baller_call(Baller::Object $obj) {
if ($obj.inputs.grep({ ! .get_value($obj).defined })) {
die "input register for $obj had empty value";
}
#FIXME feels like 'callpoint' belongs in the metaclass
my $sub = $obj.callpoint;
$obj.$sub();
#FIXME feels like 'outputs' belongs in the metaclass
for $obj.outputs -> $out {
for $out.edges -> $edge {
#say "$out -> $edge";
$edge.propagate;
}
#FIXME set_value() has warnings against use, what is better?
#$out.set_value($obj, Nil);
}
#$obj.inputs.map({ .set_value($obj, Nil) });
return;
}
sub baller_connect(Baller::Object $out, Str $out_name, Baller::Object $in, Str $in_name) {
my $out_attr = $out.output($out_name);
my $in_attr = $in.input($in_name);
push($out_attr.edges, Baller::Edge.new($out, $out_attr, $in, $in_attr));
}
It actually runs and outputs a saw toothed value from 1 to 10. I'm very much impressed with Perl 6.
This is part 0 of a series on Perl 6. The next entry is called Perl 6: Roles and Traits for President of the Universe
edit 1> Changed 1994 to 1995 - that's still 20 years worth of learning to think the way Perl does. I started on a 486 running Slackware distributed as a set of 10 floppy disks. At the same time I had a 386 sx laptop that took an entire night to compile the Linux kernel. I'm pretty sure I still had either MFM or RLL hard drives in service at that point because everything was shoe string. Setting up XFree86 needed some respect: it was still quite possible to ruin the CRT if the mode lines were wrong.
edit 2> Added link to next journal entry.
Lobbyists, in Strategy Session, Conclude That Refugee Crisis “Helps Us” Defeat Regulations
In an audio recording of a strategy session obtained by The Intercept, major trade association lobbyists discussed how the refugee crisis has changed the political dynamics in Washington to their advantage.
In the conference call held last week, lobbyists representing a number of high-polluting industries agreed that the battle between Congress and President Obama on refugee policy will give them the cover they need to attach a legislative rider to the omnibus budget bill that rolls back newly expanded clean water regulation.
“I think that probably helps us,” one participant said, referring to the coming confrontation over refugee policy.
[...] “We’re suddenly not the big issue,” said one call participant. “I mean, this is all going to turn on refugees.”
“I think that helps us,” said another call participant. “I think it helps us with the White House being on defense,” another legislative strategist on the call said.
The remarks were made during a political strategy call hosted last week by energy utility industry lobbyists. A recording was sent to The Intercept by someone on the call.
Coal CEO Thanks Lamar Smith, Asks Him to Expand Probe of Climate Scientists
Koch "Alliance" on Criminal Justice Reform Exposed as Trojan Horse
How the Gates Foundation Reflects the Good and the Bad of "Hacker Philanthropy"