Re:How I Learned to Stop Worrying and Love the State Machine
by bushin on Monday February 26, 2018 @09:24PM
(#16470669)
Well, maybe someday Dotty will be a mainstream language...
[ Parent
| on HN ]
Re:How I Learned to Stop Worrying and Love the State Machine
by icebraining on Tuesday February 27, 2018 @02:56AM
(#16471780)
Python already is a mainstream language:
class Weapon: pass
class Sword(Weapon): pass
class Staff(Weapon): pass
class Dagger(Weapon): pass
class Player:
weapon: Weapon
class Wizard(Player):
weapon: Optional[Union[Dagger, Staff]] = None
class Warrior(Player):
weapon: Optional[Union[Dagger, Sword]] = Sword()
Re:How I Learned to Stop Worrying and Love the State Machine
by icebraining on Tuesday February 27, 2018 @02:50AM
(#16471757)
class Wizard extends Player {
type T = Dagger | Staff
var weapon: T = null
}
The billion-dollar mistake in a new language? What a waste.