Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [golo-dev] Golo and logical operators + Input/Output streams

Hello Vincent, and thanks for your interest in Golo!

For your I/O issue, I think the sample at
http://golo-lang.org/documentation/next/index.html#_primitive_data_types
is what you are looking for, or else I missed something.

But you are right, Golo does not provides binary operators.
It would indeed be nice to have some functions doing this kind of thinks,
maybe in a `gololang.binary` package. Things that come to mind:
- binary operators (and, or, xor, left/right shift)
- augmentation on `java.lang.Byte` with the previous functions
- maybe functions to ease dealing with byte arrays (e.g. wrapper around
  newTypeArray(byte.class, ...)),
- maybe high level binary IO functions
- ...

Feel free to contribute!

Regards, 

Yannick



Vincent (2017-02-13 00:18):
> Hello,
> 
> For fun I'm creating a small application in Golo. It aims to write a
> file for an obsolete 1987 binary 16-bit DOS sequencer format. Don't ask,
> I have weird hobbies ;-)  
> 
> I had to write the binary file reading and writing in Java, as I could
> not find a way to get DataInputStream to work with Byte[] arrays
> (created by the newTypedArray function) and I believe Golo does not have
> the logical operators, like AND/OR and bit-shifting that were required.
> It was not a problem, the Java classes are working very well in my Golo
> project, but I thought I should still mention it here.
> 
> If I'm right, perhaps it would be an idea to have some wrapper functions
> for logical operators in the standard library of Golo? For IoT projects
> this would be useful I think.  I can imagine it's not easy to implement
> as everything is an Object in Golo, I'll experiment with it and see what
> happens.
> 
> About the I/O streams, Perhaps I should create a Golo-friendly classes
> that wraps some common Java input/output streams and make them available
> on GitHub for others. I'd love to contribute stuff, I'm really liking
> Golo's simplicity a lot.
> 
> Regards,
> Vincent
> 
> _______________________________________________
> golo-dev mailing list
> golo-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/golo-dev
> 

Attachment: signature.asc
Description: PGP signature


Back to the top