vinc has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 256 seconds]
vinc has joined #ruby
<Al2O3>
lol, A grapheme cluster is a collection of symbols that together represent an individual character that the user will see within a string on the screen.
<Al2O3>
but a grapeheme cluster sounds like something left after using the restroom.
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
vinc has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
Guest99 has joined #ruby
<Guest99>
hello
<Guest99>
hello
<Guest99>
Who can help me create a second constructor in C API?
<havenwood>
I think `chars` is overused and `grapheme_clusters` is underused, mostly because `chars` has been around much longer. I'd prefer defaults to be UTF-8 friendly. We have some oddness around `chars`, `size`, `codepoints`.
<havenwood>
Guest99: Just curious, but what's a second constructor? Like overriding initialize?
<Guest99>
again: Who can help me create a second constructor in C API?
<Guest99>
I need creating a 2 constructor in C
jenrzzz_ has quit [Ping timeout: 268 seconds]
<Guest99>
I must using rb_obj_call_init() and allocate a object, but how?
<Guest99>
Any working example?
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
<havenwood>
Guest99: See my question above? You're doing something like `rb_obj_alloc` followed by `rb_obj_call_init`? Normally on the Ruby side we'd have secondary constructors use `new` unless we need to `allocate` instead and do some parts of `new` manually, which is rare.
<Guest99>
No I can see ;(
<Guest99>
my library have 2 different way to create obkect
<ruby[bot]>
Guest99: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
jenrzzz has quit [Ping timeout: 252 seconds]
vinc has joined #ruby
<adam12>
Guest99: What's not working about it?
<adam12>
Maybe you want rb_define_singleton_method
<Guest99>
ooo.rb:5:in `<main>': undefined method `neww' for MuOWN:Class (NoMethodError)
<Guest99>
e = MuOwn.neww
<Guest99>
Did you mean? new
TomyWork has quit [Remote host closed the connection]
Guest99 has quit [Quit: Client closed]
vinc has quit [Read error: Connection reset by peer]
Vetheon has joined #ruby
Vetheon has quit [Changing host]
Vetheon has joined #ruby
<adam12>
I wonder if that worked...
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz_ has joined #ruby
jenrzzz has joined #ruby
Vetheon has quit [Ping timeout: 255 seconds]
jenrzzz_ has quit [Ping timeout: 260 seconds]
Linux_Kerio has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
<leftylink>
damn. my irb crashes on an autocomplete in the middle of a long line. but, maybe it is just because my irb version is too old. if it is then it doesn't make sense for me to report it as a bug
<adam12>
:\
<adam12>
Upgrade!
<leftylink>
would if I could.
<adam12>
:)
<adam12>
Is it a limitation to the project?
jenrzzz_ has joined #ruby
<havenwood>
leftylink: Add `irb` to your Gemfile.
<havenwood>
You can use newer IRB without newer Ruby.
<leftylink>
I don't have a Gemfile, but perhaps we can fix that, if I were to create a Gemfile, where should it go?
<havenwood>
leftylink: Run `bundle init` from the root of the project directory.
jenrzzz_ has quit [Ping timeout: 256 seconds]
<leftylink>
does this still apply if I'm just running irb not within the context of a project (e.g. just in my home dir) because I want to run some ruby code?
<havenwood>
I like `bundle init --gemfile gems.rb` just since I slightly prefer the optional `gems.rb` to the yelling `Gemfile` default alias.
<havenwood>
leftylink: Ahh, I misunderstood. Can you `gem update irb` or already on latest supported for your Ruby?
<havenwood>
leftylink: You might consider updating RubyGems itself and all gems with `gem update --system` followed by `gem update`.
<havenwood>
Default gems can be updated without updating Ruby, which is quite nice.
<havenwood>
Latest stable IRB is: irb 1.11.0 (2023-12-19)
<leftylink>
hmm so this is interesting. so now on irb 1.11.0, I do not have autocomplete at all. honestly I think I'll just leave it like that. I never got any use out of the autocomplete anyway. and no autocomplete means no chance of the crash (though of course now I won't be able to test whether the crash would happen)
vinc has joined #ruby
<havenwood>
leftylink: A `irb_info` from within `irb` might give you some clues on the autocomplete issue.
<havenwood>
An*
<havenwood>
InputMethod: RelineInputMethod with Reline 0.4.2