Cross-compile from OSX to i386 doesn't produce compile script

2019-11-05 Thread Kosteg
Did this: nim c --cpu:i386 --os:linux --compileOnly --genScript hello_world.nim Run Got "operation successful". But the only file I got is "hello_world.deps". There are no compile scripts or C-files produced.

How to implement observer (publish/subscribe) pattern?

2020-05-20 Thread Kosteg
The publisher has to maintain the list of subscribers. It's easy to implement if all the subscribers are of the same type (or of the multiple pre-defined types). But is it possible to do not specify all possible types of subscribers?

Re: VSCode debug: strings and booleans are ugly

2020-05-28 Thread Kosteg
Unfortunately this won't work - GDB doesn't work on Mac since 10.14 Mojave

VSCode debug: strings and booleans are ugly

2020-05-26 Thread Kosteg
Is there a way to get human readable strings and booleans in VSCode debugging? Debugging successfully stops at breakpoints. Ints, floats, arrays are human readable in the debug panel. But string values look like 0x00010012c048 and booleans look like 'x01'. I use mac, native debug and lldb

Re: How to implement observer (publish/subscribe) pattern?

2020-05-27 Thread Kosteg
I can do this but it's not convenient to have all the subscribers be of the same class

Re: How to implement observer (publish/subscribe) pattern?

2020-05-21 Thread Kosteg
Thank you! Works great: import tables type EventEmitter = ref object eventsMap: Table[string, seq[proc(event: string)]] proc subscribe(emitter: EventEmitter, event: string, callback: proc(event: string)) = if not emitter.eventsMap.hasKey(event):