ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
snsei has joined #crystal-lang
astronavt has joined #crystal-lang
astronavt has quit [Ping timeout: 255 seconds]
astronavt has joined #crystal-lang
astronavt has quit [Client Quit]
astronavt has joined #crystal-lang
balduin has joined #crystal-lang
<hightower4> Asked a couple days ago with no particular answer: how can I change the uid/gid from within the program? I'm looking for equivalent of Ruby's Process::UID.change_privilege
vivus has quit [Quit: Leaving]
<FromGitter> <MrSorcus> > **<hightower4>** Asked a couple days ago with no particular answer: how can I change the uid/gid from within the program? I'm looking for equivalent of Ruby's Process::UID.change_privilege ⏎ I think that crystal has no builtin function/method for changing uid/gid...
<FromGitter> <MrSorcus> > **<hightower4>** Asked a couple days ago with no particular answer: how can I change the uid/gid from within the program? I'm looking for equivalent of Ruby's Process::UID.change_privilege ⏎ ⏎ I think that crystal has no builtin function/method for changing uid/gid...
<FromGitter> <MrSorcus> > **<hightower4>** Asked a couple days ago with no particular answer: how can I change the uid/gid from within the program? I'm looking for equivalent of Ruby's Process::UID.change_privilege ⏎ ⏎ https://github.com/jhass/carc.in/blob/master/src/carcin/core_ext/process.cr - Here something with changing uid. Maybe you can use it for writing your own shard...
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
aroaminggeek has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
aroaminggeek has quit [Quit: Textual IRC Client: www.textualapp.com]
snsei has joined #crystal-lang
balduin has left #crystal-lang [#crystal-lang]
astronavt has quit [Disconnected by services]
astronavt has joined #crystal-lang
astronavt has quit [Disconnected by services]
astronav_ has joined #crystal-lang
Guest77633 is now known as Cyrus
Cyrus has quit [Changing host]
Cyrus has joined #crystal-lang
astronav_ has quit [Remote host closed the connection]
faustinoaq has joined #crystal-lang
astronav_ has joined #crystal-lang
aroaminggeek has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <drosehn> hightower4: I have a crystal program which does that. I keep thinking I should clean it up a bit and submit it somewhere.
<FromGitter> <drosehn> most likely, as an issue in crystal's github.
<FromGitter> <drosehn> Well, I don't have `Process::UID.change_privilege`, but I do have `Process.egid=`, `Process.gid=`, `Process.euid=`, and `Process.uid=`.
<FromGitter> <drosehn> (Oops, I see they're already gone. Unfortunately I've been busy all weekend replacing/rebuilding an SSD disk which had gone into read-only mode, so I think this the first I've been on gitter since Friday).
<FromGitter> <drosehn> ... and really, I'm about ready to head to bed anyway. it's been a long weekend!
<FromGitter> <drosehn> (and not in a good way)
astronav_ has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
aroaminggeek has quit [Quit: Textual IRC Client: www.textualapp.com]
jaitaiwan has left #crystal-lang ["Leaving"]
Ven has joined #crystal-lang
Ven is now known as Guest85501
flaviodesousa has joined #crystal-lang
Guest85501 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest409
Guest409 has quit [Client Quit]
Ven has joined #crystal-lang
Ven is now known as Guest63647
mark_66 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #crystal-lang
sz0 has joined #crystal-lang
gtramontina has joined #crystal-lang
Groogy has quit [Disconnected by services]
Groogy_ is now known as Groogy
<Groogy> Morning!
Groogy2 has joined #crystal-lang
kosmonaut has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #5314: Abstract LibGC usages. Reenable null garbage collector. (master...core-abstract-garbage-collector) https://git.io/vFQrF
<FromGitter> <sam0x17> morning!
<FromGitter> <sam0x17> is there any documentation on the Time type available? I'm having trouble finding anything in the docs
<FromGitter> <sam0x17> I need to force something to utc
Papierkorb_ has joined #crystal-lang
Guest63647 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest85201
<RX14> @sam0x17 time has docs? https://crystal-lang.org/api/0.23.1/Time.html
rohitpaulk has joined #crystal-lang
<RX14> do you have a time in localtime and want to convert to UTC or what?
<FromGitter> <sam0x17> thanks -- that page literally doesnt come up when you search for Time
<FromGitter> <sam0x17> and yes, though looks like all I need is `.to_utc`
<FromGitter> <bew> In https://github.com/crystal-lang/crystal/pull/5314/files#diff-4155c59db975b2d9a0b2935f7920a10aR1 why is there no difference between `__crystal_malloc` & `__crystal_malloc_atomic` ?
Guest85201 has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven is now known as Guest16662
Ven has joined #crystal-lang
Guest16662 has quit [Read error: Connection reset by peer]
Ven is now known as Guest4030
gtramontina has quit [Ping timeout: 240 seconds]
faustinoaq has quit [Remote host closed the connection]
faustinoaq has joined #crystal-lang
gtramontina has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
faustinoaq has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
Guest4030 has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven is now known as Guest21780
<Papierkorb_> bew, good catch. that doesn't look right
Guest21780 has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
<FromGitter> <bew> thanks @Papierkorb, I've mentioned it on that pr
<FromGitter> <extremety1989> guys what do you think about this code
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a12c190f257ad9109b90a47]
<FromGitter> <extremety1989> is that correct ?
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest96202
<Papierkorb_> ... what is that supposed to do?
<FromGitter> <extremety1989> just asigning values
<FromGitter> <extremety1989> because in c you can define sizeof int, for memmory performance
<Papierkorb_> Be more precise.
<Papierkorb_> huh?
<FromGitter> <extremety1989> have you programmed in C ?
<Papierkorb_> Yes, for multiple years.
<Papierkorb_> And that code there doesn't make sense even in C
<Papierkorb_> Although C would throw a tantrum on type violations
<FromGitter> <extremety1989> it is merry allocation on stack
<Papierkorb_> It's not.
<Papierkorb_> It's not in C either.
<Papierkorb_> What are you trying to do?
<Papierkorb_> I'm asking this now for the second, and last time
<FromGitter> <extremety1989> i want learn the structs in Crystal lang with c library, just can 't find good documentation
<FromGitter> <extremety1989> -.-
<FromGitter> <extremety1989> thanks anyway
<Papierkorb_> It tells you how to use it, and how it's allocated.
<FromGitter> <extremety1989> thanks
Guest96202 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
faustinoaq has quit [Quit: IRC client terminated!]
PixeLInc has quit [Ping timeout: 240 seconds]
PixeLInc has joined #crystal-lang
gtramontina has quit [Remote host closed the connection]
gtramontina has joined #crystal-lang
sz0 has joined #crystal-lang
gtramontina has quit [Ping timeout: 248 seconds]
faustinoaq has joined #crystal-lang
<RX14> @sam0x17 where did you search?
gtramontina has joined #crystal-lang
faustinoaq has quit [Ping timeout: 240 seconds]
gtramontina has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
sevensidedmarble has quit [Quit: WeeChat 1.0.1]
sevensidedmarble has joined #crystal-lang
gtramontina has joined #crystal-lang
snsei has joined #crystal-lang
gtramontina has quit [Ping timeout: 264 seconds]
<FromGitter> <Shalmezad> Is https://crystalshards.xyz/ offline?
<FromGitter> <sdogruyol> yes
gtramontina has joined #crystal-lang
gtramontina has quit [Ping timeout: 248 seconds]
sweetmeme has joined #crystal-lang
sweetmeme has left #crystal-lang [#crystal-lang]
faustinoaq has joined #crystal-lang
DTZUZU has joined #crystal-lang
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <fridgerator> @Shalmezad you can use https://crystalshards.org/
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <sam0x17> @RX14 looks like I've been searching in the main / tutorial section and not in API, which I didn't know how to get to
sz0 has quit [Quit: Connection closed for inactivity]
<RX14> Should really link to the api docs from the langref
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
gtramontina has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
gtramontina has quit [Ping timeout: 255 seconds]
mark_66 has quit [Remote host closed the connection]
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
hightower2 has quit [Ping timeout: 255 seconds]
Liothen has quit [Ping timeout: 264 seconds]
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
shankar has joined #crystal-lang
gtramontina has joined #crystal-lang
shankar has quit [Ping timeout: 258 seconds]
gtramontina has quit [Ping timeout: 255 seconds]
Papierkorb_ has quit [Quit: Konversation terminated!]
gtramontina has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
gtramontina has quit [Ping timeout: 248 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
DissonantGuile has joined #crystal-lang
hightower3 has joined #crystal-lang
<DissonantGuile> Hiyas, is there a better way to go about this? https://gist.github.com/RyanScottLewis/db5a9d9401f73c5fd4446936634ab1bb
<DissonantGuile> I'm getting "'self' was used before initializing instance variable"
aroaminggeek has joined #crystal-lang
aroaminggeek has quit [Client Quit]
hightower4 has quit [Ping timeout: 268 seconds]
<FromGitter> <picatz> @extremety1989 I learned a lot about C bindings when building https://github.com/picatz/packetz -- let me know if you have any questions!
snsei has quit [Remote host closed the connection]
<FromGitter> <picatz> I should make a blog post for people to show how I went about figuring out ( with the help of the people in this chat ❤️ ) I also need to update `packetz`. 🙈
<RX14> DissonantGuile, you call interface_class.new(self)
<RX14> so the constructor of interface_class has a reference to self
<RX14> if the interface_class constructor calls a method on self, that's be unsafe because the constructor hasn't finished yet and @interface isn't set
<RX14> which means it's garbage and will crash
<RX14> so it can't compile
<RX14> typically in this situation you have to late-initialize one or the other of the two
<RX14> here i'd suggest storing interface_class in @interface_class then having a `getter interface { @interface_class.new(self) }`
<DissonantGuile> That's what I was getting at, so I basically have to make either @application or @interface nilable?
<DissonantGuile> Oh that's a good idea
<RX14> yes, here you make @interface nillable
<RX14> but it's getter will always lazy-init
<RX14> the downside being that you can get an infinite loop at runtime
<RX14> call `interface` -> construct `@interface_class` -> calls `interface` etc
<DissonantGuile> Dang I'm just trying to decouple interfaces from app logic without nil checking everywhere
<RX14> or you could do it the other way around
<FromGitter> <extremety1989> @picatz oh, thank you to much, for newcommer, it is so hard to find good exemple tutorials of Crystal lang
<RX14> make @application late-set
<RX14> for example have property! application
<RX14> and then do @interface = interface_class.new
<RX14> then @interface.application = self
<RX14> which is more safe actually
<RX14> since it'll raise instead of loop
<RX14> hmm
<FromGitter> <picatz> @extremety1989 I will be making that blog post as soon as I can. 👍
<RX14> yeah thats better
<DissonantGuile> But then I would have to change the "if @application.not_nil! && @application.verbose" everywhere right? In my real app I have many more app wide attributes
snsei has joined #crystal-lang
<RX14> no
<RX14> because you can use getter!
<RX14> getter! defines a nillable instance variable but a raise-on-nil getter
gtramontina has joined #crystal-lang
<RX14> so you always use the getther method which encapsulates the raise on nil behaviour
<RX14> besides - what you said wouldn't work
<DissonantGuile> Ah that bit in the docs were a bit confusing but it have me a better error when I used the bang getter so I stuck with it without fully understanding it
<RX14> you'd need to set application = @application first
<FromGitter> <extremety1989> @picatz would be great to make some tutorials, for exeple crud operations with channels using postgres, Crystal-lang website lacks of new turorialss...
<RX14> to make it thread safe for the type checker
<RX14> because the type checker only allows thread-safe type checks, and accessing @application isn't thread-safe
<DissonantGuile> That makes sense
<RX14> i mean accessing 'application twice isn't thread safe
<RX14> plus not_nil! is the wrong method
<faustinoaq> Hey. there is 2486 crystal repos on https://crystalshards.org/, How many would be true shards? I mean projects created using `crystal init lib`
<RX14> not_nil! just raises
<RX14> you want nil? instead
<RX14> but most people use truthiness
<RX14> instead of nil?
<RX14> if foo to check foo isn't nil and unless foo to check that it is
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a131790ba39a53f1ac3193a]
<DissonantGuile> Right with this case I'd want it to raise because no interface means nothing happens
<RX14> which works unless you have Bool?, which is extremely uncommon
<DissonantGuile> Or no application, same deal
<FromGitter> <extremety1989> how can i send array in socket ?
<RX14> DissonantGuile, yes but not_nil! and then accessing it would still be wrong
<DissonantGuile> Normally I'd just do a nil? check
<RX14> you'd want @application.not_nil!.method_call
<FromGitter> <extremety1989> in /opt/crystal/src/http/web_socket.cr:65: no overload matches 'HTTP::WebSocket::Protocol#send' with type Array(Array(PG::BoolArray) | Array(PG::CharArray) | Array(PG::Float32Array) | Array(PG::Float64Array) | Array(PG::Int16Array) | Array(PG::Int32Array) | Array(PG::Int64Array) | Array(PG::StringArray) | Bool | Char | Float32 | Float64 | Int16 | Int32 | Int64 | JSON::Any | PG::Geo::Box | PG::Geo::Circle
<FromGitter> ... | PG::Geo::Line | PG::Geo::LineSegment | PG::Geo::Path | PG::Geo::Point | PG::Geo::Polygon | PG::Numeric | Slice(UInt8) | String | Time | UInt32 | Nil) ⏎ Overloads are: ⏎ ⏎ 1) HTTP::WebSocket::Protocol#send(data : Bytes, opcode : Opcode, flags = Flags::FINAL, flush = true) ⏎ 2) HTTP::WebSocket::Protocol#send(data : String ... [https://gitter.im/crystal-lang/crystal?at=5a1317bc614889d475a4480d]
<DissonantGuile> Oh that's funky
<RX14> instead of the not_nil! and &&
<RX14> DissonantGuile, not_nil! is just a method
snsei has quit [Ping timeout: 250 seconds]
<RX14> if it's nil it raises
<RX14> if it's not it returns self
<RX14> so the only thing it makes not nil is it's return type
<DissonantGuile> Right that's very ruby like
<faustinoaq> <@RX14> by truthiness you mean `if something = something_that_would_be_nil; something; end` ?
gtramontina has quit [Ping timeout: 240 seconds]
<RX14> it's not useful for type restrictions in any other way
<RX14> DissonantGuile, it doesn't even use if, we just define def not_nil!; self; end on Object then define struct Nil; def not_nil!; raise; end; end :)
<RX14> faustinoaq, yes
<FromGitter> <picatz> @extremety1989 Any other things you'd like to have examples of? :D
<RX14> i never use nil? and friends
<RX14> truthiness is much cleaner
<RX14> well nil? actually doesn't have friends
<Papierkorb> Note that `#nil?` is an actual language construct, not a normal method
<RX14> ^
<RX14> it acts like one though
<RX14> so you can think of it as one
<RX14> except it's that way so it can be used by the type checker
<RX14> (otherwise you could override nil? to always be false and boom segfault)
<FromGitter> <extremety1989> @picatz ``` ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5a1318db614889d475a44fac]
<FromGitter> <extremety1989> @picatz
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a1318e771ad3f87360b3d18]
<FromGitter> <extremety1989> i get this error
<FromGitter> <extremety1989> in /opt/crystal/src/http/web_socket.cr:65: no overload matches 'HTTP::WebSocket::Protocol#send' with type Array(Array(PG::BoolArray) | Array(PG::CharArray) | Array(PG::Float32Array) | Array(PG::Float64Array) | Array(PG::Int16Array) | Array(PG::Int32Array) | Array(PG::Int64Array) | Array(PG::StringArray) | Bool | Char | Float32 | Float64 | Int16 | Int32 | Int64 | JSON::Any | PG::Geo::Box | PG::Geo::Circle
<FromGitter> ... | PG::Geo::Line | PG::Geo::LineSegment | PG::Geo::Path | PG::Geo::Point | PG::Geo::Polygon | PG::Numeric | Slice(UInt8) | String | Time | UInt32 | Nil)
claudiuinberlin has joined #crystal-lang
<RX14> socket.send needs a string
<RX14> you're not giving it a string
<FromGitter> <extremety1989> ok then note.to_s ?
<RX14> depends on what you want to do
<DissonantGuile> RX14: So I switched it up as suggested and am getting nil errors like I thought hmm I must be doing something wrong https://gist.github.com/RyanScottLewis/458d7db9b3aba2fcb4ab08de9964a1c7
<FromGitter> <extremety1989> send json array to render in frontend
<RX14> so how do you expect it to magically convert to json?
<RX14> firstly, thats not how you should use crystal_db
<RX14> rs.read should almost always be given a type
<FromGitter> <extremety1989> i just fixed erro =)
<RX14> you want to do `id = rs.read(TypeOfId); data = rs.read(TypeOfData)`
<FromGitter> <picatz> RX14 is def going to be a better help on that than I will be. 👏
<RX14> and then perhaps `socket.send {id: id, data: data}.to_json`
<RX14> or even better:
<FromGitter> <extremety1989> oo thanks
<FromGitter> <extremety1989> i tried this
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a1319ede606d60e34e9ad69]
<FromGitter> <extremety1989> that works
<FromGitter> <extremety1989> converted to string
<RX14> but thats not json
<RX14> and it's also terrible
rohitpaulk has joined #crystal-lang
<FromGitter> <extremety1989> yeah you right i jjst got types rendered in my frontend aahahah
<FromGitter> <picatz> *Not optimal* is probably a better ( nicer ) way to put it :P
<FromGitter> <extremety1989> @FromIRC goint to try you proposition
<RX14> gets you your JSON string
<RX14> conn.query_all("SELECT id, data FROM notes", as: {IdType, DataType}).to_json
<FromGitter> <extremety1989> yes Int64
<RX14> DissonantGuile, just a sec
<RX14> i assume IdType is probablt Int64
<RX14> the getter! defines a getter method
<RX14> DissonantGuile, you're still using @application
<RX14> and idk what DataType is
<RX14> and then just use socket.send on the result of that
<RX14> read it from your DTD
<RX14> obviously it does nothing if you bypass the getter and go straight to @application
<RX14> just s/@application/application/ and it should work DissonantGuile
<DissonantGuile> I'm a dunce. Thank you
<RX14> np
<RX14> done it many times
<RX14> just one of those things you learn how to spot after getting familiar with the language
<FromGitter> <extremety1989> @FromIRC not i get this error
<FromGitter> <extremety1989> Error in src/index.cr:58: instantiating 'Note:Class#all(DB::Database)' ⏎ ⏎ ``` notes.to_s.map do |note|``` [https://gitter.im/crystal-lang/crystal?at=5a131b19cc1d527f6b940d42]
<RX14> please show me your code
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a131b59540c78242d29202f]
<FromGitter> <extremety1989> that what i get
<FromGitter> <extremety1989> Error in src/index.cr:58: instantiating 'Note:Class#all(DB::Database)' ⏎ ⏎ ``` notes.to_s.map do |note| ⏎ ^~~``` [https://gitter.im/crystal-lang/crystal?at=5a131bb9f257ad9109bb28eb]
<RX14> that seems to be unrelated to that piece of code specifically
<FromGitter> <unreadable> any opengl guys here?
<RX14> you're defining def all to be an instance method but calling a class method
<RX14> there seems to be an unrelated class method there already?
<FromGitter> <extremety1989> @FromIRC yes i do
<FromGitter> <extremety1989> in src/models/note.cr:51: undefined method 'map' for String (did you mean 'tap'?)
<RX14> yeah well there's not enough code there to debug this
<RX14> you've done something weird
<RX14> you're not calling the method you showed me when you write Note.all
<RX14> did you mean def self.all
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a131c352837ee5106a8fe39]
<FromGitter> <extremety1989> yes
<FromGitter> <extremety1989> it works
<FromGitter> <extremety1989> just added self.all
<FromGitter> <extremety1989> this code works perfectly formatted json
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a131d48df09362e67311798]
<FromGitter> <extremety1989> thank you guys =)
gtramontina has joined #crystal-lang
gtramontina has quit [Ping timeout: 248 seconds]
faustinoaq has quit [Ping timeout: 248 seconds]
ShalokShalom has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
Hates_ has joined #crystal-lang
<FromGitter> <johnjansen> hi again all !!!
<FromGitter> <extremety1989> hi =)
<FromGitter> <Hates> I'm trying to cross compile a small app from OSX to Ubuntu. I'm following the cross compile instructions but the `cc` command that gets outputted has paths that reference my local machine, for example, the `-lpthread` argument. So this doesn't work when I try and run it on the target machine. Any ideas?
<FromGitter> <Hates> ```code paste, see link```
<Papierkorb> Translate the paths yourself?
<FromGitter> <Hates> Is there any other way if I don't have Crystal installed on the target machine?
<Papierkorb> You don't, except for the libraries of course.
<FromGitter> <johnjansen> @Papierkorb can you give me a wee reminder on something … since i know you will know the answer, and ive been lost in another project for a few months … ;-)
<FromGitter> <Hates> Ok, I'll try and get crystal installed. Thanks :)
<Papierkorb> you don't need crystal
<Papierkorb> johnjansen, huh?
<FromGitter> <johnjansen> ```code paste, see link``` ⏎ ⏎ gives me a `mock_server.cr:8: undefined method ‘d’` and im a little perplexed this morning [https://gitter.im/crystal-lang/crystal?at=5a132b1f2837ee5106a95831]
<FromGitter> <johnjansen> i know the answer will be obvious ...
<Papierkorb> No idea.
<Papierkorb> Nexer needed that, as I wouldn't write it like that
<Papierkorb> never*
<FromGitter> <johnjansen> ;-)
<FromGitter> <johnjansen> ok … thanks for taking a look
<FromGitter> <johnjansen> i wont be writing it like that either …
<Papierkorb> If you feel it's a bug, open an issue, and/or wait for other people to comment
<FromGitter> <johnjansen> i will, thanks … im not sure how to classify it yet
<FromGitter> <johnjansen> trying to think why it might be out of scope
<FromGitter> <johnjansen> within the block that defined it
<FromGitter> <johnjansen> i “think” its a bug, since it is only when its assigned to the class var that the problem starts
<FromGitter> <johnjansen> which would make the error wrong too … potentially
<FromGitter> <johnjansen> i need a better brain than mine on it today … i blame too much holiday cheer over the weekend
<FromGitter> <johnjansen> fairly sure its a bug https://play.crystal-lang.org/#/r/34h0
<FromGitter> <johnjansen> or maybe not, since its been like that forever
faustinoaq has joined #crystal-lang
gtramontina has joined #crystal-lang
gtramontina has quit [Ping timeout: 240 seconds]
faustinoaq has quit [Read error: Connection reset by peer]
faustinoaq has joined #crystal-lang
gtramontina has joined #crystal-lang
gtramontina has quit [Ping timeout: 260 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
gtramontina has joined #crystal-lang
<FromGitter> <codenoid> morning !
gtramontina has quit [Ping timeout: 248 seconds]
<FromGitter> <bew> @johnjansen your last example is not a bug
<FromGitter> <johnjansen> yeah i figured
<FromGitter> <bew> I know there's an issue about that, with explanation somewhere
<FromGitter> <johnjansen> just trying to understand what the correct way to achieve this is though
<FromGitter> <johnjansen> even using option parser sensibly without this type of assignment is tricky
<Papierkorb> There are plenty OptionParser replacement shards
<FromGitter> <johnjansen> its not really about that per-se, but that is where i discovered the issue (well its an issue for me)
<FromGitter> <johnjansen> at least till i discover the intended approach
<Papierkorb> it's more useful used imperatively outside an object
<Papierkorb> But eh
<FromGitter> <johnjansen> how about if the object is a singleton
<Papierkorb> I'd not use it outside of script-y helper programs
<FromGitter> <johnjansen> option parser aside, i think i simply have the wrong approach to what im trying to achieve, so ill persevere and see what i come up with … thanks for all the comments
gtramontina has joined #crystal-lang
<Papierkorb> I avoid running code inside class/module bodies in general. So, I guess that kinda "saves" me from funky behaviour and bugs lul
<Papierkorb> johnjansen, if you insist on using optparser, you can use it to fill an object, just not from inside the objects class. technically, from inside any method would be fine too. or just from outside, in your main .cr file, where it can be easily found. Should be fine if you don't have too many options
<FromGitter> <johnjansen> optparser works fine … the issue is elsewhere honestly
gtramontina has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
gtramontina has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
gtramontina has quit [Ping timeout: 240 seconds]
Liothen has joined #crystal-lang
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
Hates_ has quit [Quit: Connection closed for inactivity]
gtramontina has joined #crystal-lang
gtramontina has quit [Ping timeout: 248 seconds]
ShalokShalom has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
gtramontina has joined #crystal-lang
gtramontina has quit [Client Quit]
raz has quit [Ping timeout: 252 seconds]
raz has joined #crystal-lang
raz has quit [Changing host]
raz has joined #crystal-lang
faustinoaq has quit [Remote host closed the connection]
faustinoaq has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
faustinoaq has quit [Ping timeout: 248 seconds]
faustinoaq has joined #crystal-lang
faustinoaq has quit [Client Quit]
faustinoaq has joined #crystal-lang
faustinoaq has quit [Ping timeout: 248 seconds]
p0p0pr37 has quit [Remote host closed the connection]
faustinoaq has joined #crystal-lang
<FromGitter> <elorest> Potentially useful tool for easily running code in a console like fashion. Check it out and let me know what you think. ⏎ https://github.com/elorest/cry
<FromGitter> <elorest> Based some of it off of pry.
<Papierkorb> what makes it different from icr?
<oprypin> it runs only one line, i dunno
<oprypin> and you can't require aor make a class or anything
<oprypin> i was like, how did he solve the 'eval' problem
<oprypin> >> "as seen on carc.in"
<DeBot_> oprypin: # => "as seen on carc.in" - https://carc.in/#/r/34ij
<oprypin> and then i see `"puts (#{args.code}).inspect"` mkay
<oprypin> crystal eval really should do this out of the box tho
<FromGitter> <elorest> <Papierkorb> It’s different than icr because it doesn’t pretend to be a console. ⏎ Rather it puts code in a tmp file and runs it. You can get back to a previous run with `cry -b #`
<FromGitter> <elorest> <oprypin> Yeah it is similar to carc.in but uses vim and isn’t web based. Also keeps a log of code run and results. It’s similar to pry edit, without the rest of pry. For me pry edit is one of my favorite tools though in ruby.
p0p0pr37 has joined #crystal-lang
<FromGitter> <elorest> carc.in is fantatic and I use it all the time but it’s limited because you can’t control dependencies and you have to use the web editor. It obviously has the added benifit of being sharable though. :)