I just tried to throw some array code at EOS and it seems to error out in the init. this is all I've put so far:
const Struct = (...keys) => ((...v) => keys.reduce((o, k, i) => {o[k] = v[i]; return o} , {}));
const unit = Struct('lookup1','lookup2','rank1','rank2');
I admit, there's a lot going on there. should I try to shy away from using dot notation in my arrays or should this kind of stuff work and my error is somewhere north of this?
how complicated can EOS get?
Re: how complicated can EOS get?
Hi,
I haven't done any teases, but I work with javascript for living, so maybe I can help...
How to reproduce this? (Where you put this code? In eval block? I need steps how to repro it myself)
Also, what do you want to accomplish with this? This struct seems like a function generator, so calling it like you did creates function "unit" that produces objects like this:
unit('a', 'b', 'c', 'd')
result:
{lookup1: 'a', lookup2: 'b', rank1: 'c', rank2: 'd'}
I haven't done any teases, but I work with javascript for living, so maybe I can help...
How to reproduce this? (Where you put this code? In eval block? I need steps how to repro it myself)
Also, what do you want to accomplish with this? This struct seems like a function generator, so calling it like you did creates function "unit" that produces objects like this:
unit('a', 'b', 'c', 'd')
result:
{lookup1: 'a', lookup2: 'b', rank1: 'c', rank2: 'd'}
My estim creations: https://mega.nz/folder/73pxmBBQ#X6ylDzRafzTt9wanZ0dacw
And in E-Stim Index: viewtopic.php?t=27090
Try creating your own estims with my restim script generator!
And in E-Stim Index: viewtopic.php?t=27090
Try creating your own estims with my restim script generator!
- Spoiler: show
-
kerkersklave
- Explorer At Heart

- Posts: 709
- Joined: Sun Jul 06, 2014 2:11 pm
- Gender: Male
- Sexual Orientation: Open to new ideas!
- I am a: Slave
Re: how complicated can EOS get?
EOS uses a Javascript interpreter written in Javascript for security reasons. I haven't experimented with it, but the documentation of EOS says, that it supports ECMAScript 5. Arrow-Functions have been introduced with ECMAScript 6, so they are probably just not supported. The scripts can be quite complicated, but you have to stick to ECMAScript 5. I would try using classical anonymous functions.
Re: how complicated can EOS get?
Ok so forget about ... and =>
My estim creations: https://mega.nz/folder/73pxmBBQ#X6ylDzRafzTt9wanZ0dacw
And in E-Stim Index: viewtopic.php?t=27090
Try creating your own estims with my restim script generator!
And in E-Stim Index: viewtopic.php?t=27090
Try creating your own estims with my restim script generator!
- Spoiler: show


