El Saturday, 17 de September del 2016 a les 10:21, MT va escriure:

Btw the following has the same problem;

> my Hash $h = {a=>1,b=>2}
{a => 1, b => 2}
> $h<a>:exists
True
> subset mh of Str where $h{$_}:exists
(mh)
> my mh $x = 'b'
Type check failed in assignment to $x; expected mh but got Str ("b")
  in block <unit> at <unknown file> line 1


And:
my Hash $h = {a=>1,b=>2};
{a => 1, b => 2}
subset mh of Str where $h{$_}:exists;my mh $x = 'b'
b

:O ;-)

Cheers!

I can’t help but think this can all be solved by using enums?

my enum pv ( <d f g h aa bb ff> );
my pv $x = aa;


??

On 16 Sep 2016, at 13:49, mt1957 <mt1...@gmail.com> wrote:

Hi everyone,

I am trying to create a subset but get errors when used. Surely I do something 
wrong here or is it a bug?

In REPL

my Map $p .= new(<d f g h aa bb ff>.kv.reverse);
Map.new((:aa(4),:bb(5),:d(0),:f(1),:ff(6),:g(2),:h(3)))
subset pv of Str where $_ (elem) $p;
(pv)
my pv $x = 'aa';
Type check failed in assignment to $x; expected pv but got Str ("aa")
  in block <unit> at <unknown file> line 3


Greetings,

Marce



--
(≧∇≦) Mimosinnet (Linux User: #463211)

(≧∇≦) Ningún Lugar
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
★ Activisme Cultural per a la Transformació Social

(≧∇≦) Fractalitats en Investigació Crítica
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
* Investigació Crítica per a la Transformació Social
* http://psicologiasocial.uab.es/fic

Reply via email to