Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 06 16:20
    HertzDevil unlabeled #13013
  • Feb 06 14:24
    renovate[bot] edited #12735
  • Feb 06 14:22
    straight-shoota milestoned #13048
  • Feb 06 14:22
    straight-shoota milestoned #13048
  • Feb 06 13:24
    HertzDevil labeled #13048
  • Feb 06 13:24
    HertzDevil labeled #13048
  • Feb 06 13:24
    HertzDevil labeled #13048
  • Feb 06 13:24
    HertzDevil opened #13048
  • Feb 06 12:32
    straight-shoota closed #12924
  • Feb 06 12:32
    straight-shoota closed #12921
  • Feb 06 12:31
    straight-shoota closed #12983
  • Feb 06 12:24
    straight-shoota closed #13045
  • Feb 05 15:55
    Blacksmoke16 closed #13047
  • Feb 05 15:53
    serge-hulne closed #13047
  • Feb 05 15:45
    Blacksmoke16 edited #13047
  • Feb 05 15:42
    serge-hulne labeled #13047
  • Feb 05 15:42
    serge-hulne opened #13047
  • Feb 05 02:16
    renovate[bot] edited #12735
  • Feb 04 23:27
    straight-shoota milestoned #12966
  • Feb 04 23:27
    straight-shoota milestoned #12966
Weston
@wwselleck
i tried making that "my" language, but just coudlnt
Kent 'picat' Gruber
@picatz
I've done some weird stuff like doing go bindings to ruby.
Weston
@wwselleck
its just tooo bare bones. Just to make a data type sortable takes like 50 lines.
Kent 'picat' Gruber
@picatz
I think Crystal does everything go does better ( in my opinionated opinon )
Feel free to make issues or whatever as you find them and we can address them on github / put that shiz into version control
Even if you have questions for how something works.
That way, if someone else had a similar question, at least it'd be documented.
This would be triggered using ./myprogram --read
?
Kent 'picat' Gruber
@picatz
it'd be $ruby app.rb --read file.txt
for that one
( I'm dumb sometimes, sorry :smile: )
I'd like to add :file type I'd think
That way I can have a nice little wrapper for when users are working with files perhaps.
It'd be an opt-in thing, where they could just use :string and then open the file.
But, I'd like for a :file type to have some sort of builtin helper method to abort if the file doesn't exist or something maybe.
Weston
@wwselleck
command :hello do
  flag "hello"
is the flag redudant there
Kent 'picat' Gruber
@picatz
The flag would probably be redundant there, yeah.
Don't forget the end of course ;)
The command :index is used to basically be able to reference the command object elsewhere in the app.
commands and options ( which are direct subclasses of commands ) are indexed in hashes basically.
the index ( key ) being the :index symbol you give it.
The index is also used as the default flag if not specified otherwise.
I've sort of recently adopted that.
But, I'm cool with it. I think it makes things simpler without adding too much complexity. I think.
In practice there wouldn't be a big problem being redundant if people didn't know and always set the flag
I almost never use the flags block in my examples
There you can explicitly set short and long flag types.
I gotta go do some stuff, but I'll be back later :v:
Weston
@wwselleck
l8r
Weston
@wwselleck
oh boy this whole block/yield stuff is going to take some practice.
it seems similar to nodeish callbacks on the surface, but they're used very differently it seems
Kent 'picat' Gruber
@picatz
It's not too bad, but takes some getting used to: https://gist.github.com/picatz/7f280bea5b8cf05491df95fbb445d78c
You can do some nifty things with blocks.
Best thing to do is load up crystal play and play around with stuff.
For really small examples.
Stephan Langeveld
@Fanna1119
whats the difference between block one and 2 ?
1.upto(100) do |x|
    puts x
end

1.upto(100) {|x| puts x}
Kent 'picat' Gruber
@picatz
Basically a do can be a { and a end can be a }.
So, my understanding is, basically nothing.
Stephan Langeveld
@Fanna1119
@picatz ahh thank you :), coming from a non ruby background. i am still in the phase where i don't what works and what doesn't as well as not sure what is the "right" way of doing some things just yet haha
Kent 'picat' Gruber
@picatz
No worries :+1:
I don't mind helping out, at least as much as I can :joy:
cevarief
@cevarief
Is it possible to call a class without instantiating but still keep overloading?
cevarief
@cevarief
yes possible
But it should be all using self. Can self call non self method?
Rubi
@codenoid
Rubi
@codenoid
nice, i use super tab
From IRC (bridge bot)
@FromIRC
<Groogy> Morning!