objectionary / eo

EOLANG, an Experimental Pure Object-Oriented Programming Language Based on 𝜑-calculus
https://www.eolang.org
MIT License
1.02k stars 127 forks source link

the `@abstract` attribute seems to redundant #3529

Open yegor256 opened 7 hours ago

yegor256 commented 7 hours ago

We have a function eo:abstract and the @abstract attribute. It seems that the attribute is redundant: we can get rid of it and only live with the function.

yegor256 commented 7 hours ago

@maxonfjvipon WDYT?

maxonfjvipon commented 7 hours ago

@yegor256 the function checks the presence of @abstract attribute.

<xsl:function name="eo:abstract" as="xs:boolean">
  <xsl:param name="o" as="element()"/>
  <xsl:sequence select="not(exists($o/@base)) and (exists($o/o) or $o/@atom or $o/@abstract)"/>
</xsl:function>

I'm not sure we can remove the attribute because there's no unique combination of other mandatory attributes like @base or @name which may replace @abstract

maxonfjvipon commented 6 hours ago

@yegor256 or no. Actually if object does not have @base - it's already abstract. It seems that it's enough. WDYT?

yegor256 commented 5 hours ago

@maxonfjvipon yes, seems to be correct: no @base means "being abstract" or "being an atom". Maybe we can just simplify this to:

<xsl:sequence select="not(exists($o/@base)) and (exists($o/o) or $o/@atom)"/>
maxonfjvipon commented 5 hours ago

@yegor256 even exists($o/o) is not necessary because the object can be empty

yegor256 commented 4 hours ago

@maxonfjvipon let's get rid of it!