قيم الواجهات
قيم الواجهات
داخليًا، يمكن تصوّر قيم الواجهات بوصفها زوجًا يتكوّن من قيمة و نوع فعلي:
(value, type)
تحتوي قيمة الواجهة على قيمة من نوع فعلي محدّد كامن فيها.
يؤدي استدعاء تابع على قيمة واجهة إلى تنفيذ التابع الذي يحمل الاسم نفسه على نوعها الكامن.
النص الأصلي بالإنجليزية
Interface values
Under the hood, interface values can be thought of as a tuple of a value and a concrete type:
(value, type)
An interface value holds a value of a specific underlying concrete type.
Calling a method on an interface value executes the method of the same name on its underlying type.
هذا الدرس للقراءة فقط؛ جرّب المثال في الدرس التالي.