रेंडरिंगhi

लागूकरता

Translation status: हिन्दी reader-locale proof. Term names and code fences follow the hi pack; supporting prose may still be English.

Declares that a type implements one or more अनुबन्ध contracts.

Aliases: implements

Syntax: वर्ग <name> लागूकरता <interface-list> <block>

Category#

type

Examples#

radix/corpus/implet/implet.fab (canonical · keyword)#

Declares that a type implements one or more अनुबन्ध contracts.

# =============================================================================
# लागूकरता — Declares that a type implements one or more अनुबन्ध contracts
# =============================================================================
#
# What this teaches:
#   • Declares that a type implements one or more अनुबन्ध contracts.
#   • Related keywords: वर्ग, अनुबन्ध
#
# Common mistakes:
#   • Declaring `वर्ग लागूकरता Implendum` without implementing all required methods — every method signature in the अनुबन्ध must have a body in the वर्ग.
#
# See also: वर्ग, अनुबन्ध
# =============================================================================

# लागूकरता — वर्ग implements a अनुबन्ध (interface contract)
#
# वर्ग Nomen लागूकरता Implendum { … }
#
# GRAMMAR:
#   genusDecl :← 'वर्ग' ident 'लागूकरता' ident '{' methodDecl* '}'
#
# EXPECTED OUTPUT:
#   implet.expected — Aurelia from अनुबन्ध plenum().

interface Nominatum {
    fn plenum() → string
}

class Civis implements Nominatum {
    var string नाम

    fn plenum() → string {
        # satisfies अनुबन्ध requirement
        return "§"(self.nomen)
    }
}

main {
    const Civis civis ← Civis { नाम = "Aurelia" }
    print civis.plenum()
}

Expected output:

Aurelia