Q:

set parent selector as a variable

div .mymixin('red','green')    
.mymixin(@a, @b){
  a {
    color: @a;
    span {
      color: @b;
    }
  }
}

This code will produce the following css:
div a{color:red;}
div a span{color: green;}

I need it to produce this:
div a{color:red;}
div:not(.open) a span{color: green;}

I was trying to do something like this:
div .mymixin('red','green')    
@parent: &;
.mymixin(@a, @b){
  a {
    color: @a;
    @{parent}:not(.open) span {
      color: @b;
    }
  }
}

But it doesn't work the right way, producing 
div a &:not(.open) span{color:green;}

Is there a way to assign parent to a variable or do it some other way to achieve what I am after?
Thank you.
P.S. Here is the actual nesting I have:
.icfld(@name, @width, @height, @opacity, @open) {
  > a {
    ...
    > .icon {
      ...
    }
    &.disabled > .icon {
      ...
    }
    //&:not(.open) :not(.disabled):hover... will NOT work, because & at this point refers to 
    //"parent" > a and makes it "parent" > a:not(.open), while I need "parent":not(.open)
    //the following line, however, works  
    &:not(.disabled):hover {
      & when (@open=false) {
        ...
        > .icon {
          ...
        }
      }
    }
  }

A:

Came up with the following work around:
.mymixin2(@a, @b, @open){
  a {
    color: @a;
    & when(@open = false){
      span {
        color: @b;
      }
    }
  }
}
.mymixin1(@a,@b){
  &.open {.mymixin2(@a,@b,true);}
  &:not(.open) {.mymixin2(@a,@b,false);}
}

div .mymixin1('red', 'green');

This seems to do the trick. 

