Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionaler Standardwert in Kombinations Deklarationen #115

Open
bafto opened this issue Feb 5, 2025 · 0 comments
Open

Optionaler Standardwert in Kombinations Deklarationen #115

bafto opened this issue Feb 5, 2025 · 0 comments
Labels
Anfängerfreundlich Gut für Anfänger im Projekt geeignet Thema: Grammatik Die Lesbarkeit von DDP kann verbessert werden

Comments

@bafto
Copy link
Member

bafto commented Feb 5, 2025

Die einzelnen Felder in Kombinations Deklarationen brauchen im Moment zwingend einen Standardwert.
Das liegt daran, das Typen beim Hinzufügen des Features noch keine Standardwerte hatten.

Inzwischen gibt es den Standardwert Operator und für jeden Typ ist ein Standardwert definiert.
Ich schlage daher vor, dass wir den Standardwert in einer Kombinations Deklaration optional machen.

Syntax:

Wir nennen eine Kombination aus
    der Zahl z, [Standardwert 0]
    dem Text t, [Standardwert ""]
    dem Vektor2 z, [Standardwert des Vektor2 Typs]
eine Struktur und erstellen sie so:
    "Struktur"

Man kann natürlich immer noch einen Standardwert angeben wenn man es braucht, aber in den meisten Fällen genügt der vordefinierte Standardwert.

@bafto bafto added Anfängerfreundlich Gut für Anfänger im Projekt geeignet Thema: Grammatik Die Lesbarkeit von DDP kann verbessert werden labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Anfängerfreundlich Gut für Anfänger im Projekt geeignet Thema: Grammatik Die Lesbarkeit von DDP kann verbessert werden
Projects
None yet
Development

No branches or pull requests

1 participant