c0pperdragon / EV3Basic

A basic compiler to target the Lego Mindstorms EV3 intelligent brick.
50 stars 19 forks source link

Events #27

Closed OlafBr closed 5 years ago

OlafBr commented 5 years ago

Hello, are you still maintaining this library? What do you think about something like events for sensors (in a future version):

`Sensor.ValueChanged = ValueChanged

Sub ValueChanged val = Sensor.ReadRaw (...) LCD.Write (10, 10, val) EndSub`

Regards, Olaf

weixiangyong commented 5 years ago

Hello, I am more looking forward to how to write a third-party code editor so that users can write code faster.

c0pperdragon commented 5 years ago

I propose notepad++. This is a very versatile tool, and you can create extensions for syntax highlighting and all other fancy stuff.

c0pperdragon commented 5 years ago

One comment about events: The functionality of events is pretty limited in Small Basic. You can basically only directly attach a single event handler to a event property. So you would either need multiple properties (Sensor.ValueChanged1, Sensor.ValueChanged2, ...) or other means to specify on which sensor to listen (Sensor.ListenTo = 5).
Anyway this event handling would still internally need to constantly poll the sensor, so performance would be as bad as if the polling would be implemented directly in the program.

weixiangyong commented 5 years ago

This is really a very good idea, thank you

------------------ 原始邮件 ------------------ 发件人: "c0pperdragon"notifications@github.com; 发送时间: 2019年6月3日(星期一) 晚上6:52 收件人: "c0pperdragon/EV3Basic"EV3Basic@noreply.github.com; 抄送: "逐"454704698@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [c0pperdragon/EV3Basic] Events (#27)

I propose notepad++. This is a very versatile tool, and you can create extensions for syntax highlighting and all other fancy stuff.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.