עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

delphi semantics

Featured Replies

פורסם

משהו יודע אם זה reference או by value?

פורסם

נראה לי by value ברגיל ואם אתה מוסיף var בהתחלה אז by reference.

פורסם

אם אני זוכר נכון אז גם out במקום var מעביר כ- reference, ואז הקומפיילר נותן warning אם אתה לא מבצע השמה למשתנה בתוך הפונקציה.

פורסם

היתרון של out ב C# למשל זה שלא צריך לאתחל משתנה שאתה מעביר לפונקציה שמקבלת פרמטר כזה.

פורסם
  • מחבר

ניסיתי לחפש באינטרנט תשובות לגבי השאלה, אבל לא מצאתי.

משהו יודע בטוח? ואם כן, האם אפשר להביא איזה לינק?

פורסם

תשים לב ששימוש ב- var או out זה כמעט אך ורק ל- basic types.

כשאתה מעביר instances של classes (שהם למעשה - מצביעים), אתה בעצם מעביר מצביע.

פורסם
  • מחבר

יש הבדל בין סוג העברת פרמטרים (שאני די בטוח שהיא ב REFERENCE) לסמנטיקה של השפה.

השאלה מה היא הסמנטיקה של השפה?

(למשל: JAVA - REFERENCE, C - BY VALUE)

פורסם

אני רואה שאתה נורא אוהב את המילה "סמנטיקה", אבל מה בעצם השאלה שלך?

פורסם
  • מחבר

אלו "ההגדרות":

Reference Semantics

Variables hold references (i.e.: pointers)

Assignment: 0-level copying

● A new pointer to the old object

Equality test: 0-level comparison

● Aka: Identity comparison

E.g.: Java, Smalltalk

Value Semantics

Variables hold the actual objects

Assignment: At least 1-level copying

Equality test: At least 1-level comparison

E.g.: C++ (if we ignore pointers), Eiffel's expanded types

פורסם

בדלפי יש שני סוגים של אובייקטים מורכבים - class ו- record (שאריות מפסקל).

records יכולים להיות מוקצים על ה- stack, מועברים by value אלא אם מציינים var או out.

classesמוקצים רק על ה- heap וה- instances שלהם מתפקדים כ- references.

זה עונה לך על השאלה?

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.