الفرق بين المراجعتين ل"Ruby/InstructionSequence/base label"
< Ruby | InstructionSequence
اذهب إلى التنقل
اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: التابع <code>base_label</code> الخاص بالصنف <code>InstructionSequence</code> في روبي}}</noinclude> تصنيف:...') |
جميل-بيلوني (نقاش | مساهمات) ط (مراجعة وتدقيق.) |
||
(مراجعة متوسطة واحدة بواسطة مستخدم واحد آخر غير معروضة) | |||
سطر 1: | سطر 1: | ||
− | <noinclude>{{DISPLAYTITLE: التابع <code>base_label | + | <noinclude>{{DISPLAYTITLE: التابع <code>InstructionSequence.base_label</code> في روبي}}</noinclude> |
[[تصنيف: Ruby]] | [[تصنيف: Ruby]] | ||
[[تصنيف: Ruby Method]] | [[تصنيف: Ruby Method]] | ||
[[تصنيف: Ruby InstructionSequence]] | [[تصنيف: Ruby InstructionSequence]] | ||
− | يُعيد التابع <code>base_label</code> التسمية الأساسية (base label) ل[[Ruby/InstructionSequence|سلسلة التعليمات]] التي التي استُدعي معها. | + | يُعيد التابع <code>base_label</code> التسمية الأساسية (base label) ل[[Ruby/InstructionSequence|سلسلة التعليمات]] التي استُدعي معها. |
− | + | ==البنية العامة== | |
+ | <syntaxhighlight lang="ruby">base_label()</syntaxhighlight> | ||
+ | ==القيمة المعادة== | ||
+ | تعاد التسمية الأساسية (base label) ل[[Ruby/InstructionSequence|سلسلة التعليمات]] التي استُدعي معها. | ||
− | + | ==أمثلة== | |
− | <syntaxhighlight lang="ruby"># /tmp/method.rb | + | مثال على استخدام التابع <code>base_label</code>: |
+ | <syntaxhighlight lang="ruby">iseq = RubyVM::InstructionSequence.compile('num = 1 + 2') | ||
+ | #=> <RubyVM::InstructionSequence:<compiled>@<compiled>> | ||
+ | iseq.base_label | ||
+ | #=> "<compiled>"</syntaxhighlight>مثال آخر على استعمال التابع <code>base_label</code> مع استخدام التابع <code>[[Ruby/InstructionSequence/compile_file|compile_file]]</code>:<syntaxhighlight lang="ruby"># /tmp/method.rb | ||
def hello | def hello | ||
puts "hello, world" | puts "hello, world" | ||
سطر 14: | سطر 21: | ||
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb') | > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb') | ||
> iseq.base_label #=> <main></syntaxhighlight> | > iseq.base_label #=> <main></syntaxhighlight> | ||
− | + | ==انظر أيضًا== | |
− | + | * التابع <code>[[Ruby/InstructionSequence/absolute_path|absolute_path]]</code>: يُعيد المسار المطلق ل[[Ruby/InstructionSequence|سلسلة التعليمات]] المعطاة. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ==انظر | ||
− | * التابع <code>[[Ruby/InstructionSequence/absolute_path|absolute_path]]</code>: يُعيد | ||
− | |||
==مصادر== | ==مصادر== | ||
− | *[http://ruby-doc.org/core-2.5.1/RubyVM/InstructionSequence.html#method-i-base_label قسم | + | *[http://ruby-doc.org/core-2.5.1/RubyVM/InstructionSequence.html#method-i-base_label قسم التابع base_label في الصنف InstructionSequence في توثيق روبي الرسمي.] |
المراجعة الحالية بتاريخ 07:24، 4 ديسمبر 2018
يُعيد التابع base_label
التسمية الأساسية (base label) لسلسلة التعليمات التي استُدعي معها.
البنية العامة
base_label()
القيمة المعادة
تعاد التسمية الأساسية (base label) لسلسلة التعليمات التي استُدعي معها.
أمثلة
مثال على استخدام التابع base_label
:
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
#=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
#=> "<compiled>"
مثال آخر على استعمال التابع base_label
مع استخدام التابع compile_file
:
# /tmp/method.rb
def hello
puts "hello, world"
end
# in irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label #=> <main>
انظر أيضًا
- التابع
absolute_path
: يُعيد المسار المطلق لسلسلة التعليمات المعطاة.