Anonymous Login
2019-12-15 21:40 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001196OpenClonkEngine - C4Scriptpublic2014-12-28 21:19
ReporterMaikel 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0001196: Assign values to local variables using functions
DescriptionThis would allow for cleaner code like this:

local PictureTransformation = Trans_Mul(Trans_Rotate(25, 0, 1, 0), Trans_Scale(625));

Instead of this:

protected func Definition(def)
{
    SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(25, 0, 1, 0), Trans_Scale(625)), def);
}
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0003297

Sven2 (developer)

Last edited: 2014-12-28 21:19

View 2 revisions

Sounds potentially very error-prone, since such functions could not use local variables themselves. Also, consider e.g.:

local foo = Random(100);

That would mean script engine initialization would affect and depend on the sync state, which might cause difficulties on stuff like network runtime join synchronization.

So it's probably not hard to implement, but might introduce subtle bugs if not done right.

+Notes

-Issue History
Date Modified Username Field Change
2014-12-28 20:02 Maikel New Issue
2014-12-28 21:16 Sven2 Note Added: 0003297
2014-12-28 21:19 Sven2 Note Edited: 0003297 View Revisions
+Issue History