how complicated can EOS get?

All about the past, current and future webteases and the art of webteasing in general.
---
Post Reply
grelgen
Explorer
Explorer
Posts: 98
Joined: Sat Dec 18, 2021 12:50 am

how complicated can EOS get?

Post by grelgen »

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?
User avatar
edger477
Experimentor
Experimentor
Posts: 1115
Joined: Mon Nov 29, 2021 8:24 pm
Location: underfloor

Re: how complicated can EOS get?

Post by edger477 »

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'}
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!
Spoiler: show
You can also thank me with crypto: https://trocador.app/anonpay?ticker_to= ... e+a+coffee
kerkersklave
Explorer At Heart
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?

Post by kerkersklave »

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.
User avatar
edger477
Experimentor
Experimentor
Posts: 1115
Joined: Mon Nov 29, 2021 8:24 pm
Location: underfloor

Re: how complicated can EOS get?

Post by edger477 »

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!
Spoiler: show
You can also thank me with crypto: https://trocador.app/anonpay?ticker_to= ... e+a+coffee
Post Reply