[Pas2js] Records as pure data?
Sven Barth
pascaldragon at googlemail.com
Thu May 10 09:44:23 CEST 2018
Am 10.05.2018 um 04:52 schrieb Ryan Joseph:
>
>> On May 9, 2018, at 10:18 PM, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
>>
>> On Wed, 9 May 2018 21:21:42 +0700
>> Ryan Joseph <ryan at thealchemistguild.com> wrote:
>>
>>> [...]
>>> Then what happens with stuff like this? Not sure how to append arrays (didn’t like push for some reason)
>> Pascal arrays don't have "push".
>> You can typecast to TJSArray. For example TJSArray(verts).push(v); .
>> Eventually when pas2js gets array helpers you can add such things more
>> easily.
> Those should be included for certain. There’s no reason to use “array of xxx” syntax if can’t use push etc… I don’t even use them in FPC because they lack simple array features that every other language has. Dynamic arrays really should be a "toll-free bridge” to JSArray but with types for safety. Otherwise just use JSArray always.
FPC trunk supports Insert(), Delete() and Concat() and "+" operations on
dynamic arrays as well as the ability to write inline array constructors
("[1, 2, 3, 4]").
Regards,
Sven
More information about the Pas2js
mailing list