Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 19 18:53
    straight-shoota closed #11334
  • Oct 19 18:53
    straight-shoota closed #11318
  • Oct 19 18:13
    yxhuvud synchronize #11289
  • Oct 19 18:11
    yxhuvud synchronize #11289
  • Oct 19 17:34
    straight-shoota edited #11340
  • Oct 19 17:33
    straight-shoota labeled #11340
  • Oct 19 17:33
    straight-shoota labeled #11340
  • Oct 19 17:33
    straight-shoota opened #11340
  • Oct 19 17:04
    straight-shoota labeled #11339
  • Oct 19 17:04
    straight-shoota labeled #11339
  • Oct 19 17:02
    will closed #11339
  • Oct 19 16:27
    will opened #11339
  • Oct 19 16:27
    will labeled #11339
  • Oct 19 13:06
    straight-shoota milestoned #11277
  • Oct 19 12:39
    straight-shoota milestoned #11338
  • Oct 19 11:33
    straight-shoota milestoned #11327
  • Oct 19 11:33
    straight-shoota demilestoned #11326
  • Oct 19 11:33
    straight-shoota milestoned #11326
  • Oct 19 10:42
    straight-shoota labeled #11338
  • Oct 19 10:42
    straight-shoota labeled #11338
George Dietrich
@Blacksmoke16
doubled
From IRC (bridge bot)
@FromIRC
<mfiano> Given one argument, both variables should be set to the same value.
George Dietrich
@Blacksmoke16
def self.new(value : Float64) : self
  new value, value
end

def initialize(@a : Float64, @b : Float64); end
should do it
From IRC (bridge bot)
@FromIRC
<mfiano> Ah so you can only have 1 initialize method?
<mfiano> I was trying to overload that multiple times :⁠/
George Dietrich
@Blacksmoke16
no, but
tl;dr i always just mke initialize represent the actual state of the instance, but then have overloaded .new to transform the arguments into something the initializer constructs
expects*
From IRC (bridge bot)
@FromIRC
<mfiano> That post was very well explained, thanks.
George Dietrich
@Blacksmoke16
From IRC (bridge bot)
@FromIRC
<mfiano> Is there a way to alias a module at the file level?
<mfiano> I don't want to remove the full qualification, but for a long/deep module that is used all over a single file, I would like to alias it to a single character or something
George Dietrich
@Blacksmoke16
technically no, but you shouldn't need to provide the FQN if its in the same namespace

or if its in a diff namespace you can do like

```

private alias Foo = MyApp::Some::Very::Long::Namespace::Foo
private top level aliases are scoped to the file they're defined in
From IRC (bridge bot)
@FromIRC
<mfiano> Oh! I wasn't aware that program-level private stuff was file-local
From IRC (bridge bot)
@FromIRC
<mfiano> That is great
mfiano
@mjfiano:matrix.org
[m]
test
Taupiqueur
@alexherbo2
why I can't refer to Scope in Snippet::Parser?
I have Snippet::Scope struct defined, it can't find it
George Dietrich
@Blacksmoke16
can you share the code/error?
Taupiqueur
@alexherbo2
George Dietrich
@Blacksmoke16
seems the error is coming from YAML::Serializable, can you include more of the strack trace?
Taupiqueur
@alexherbo2
it's odd because if I replace struct Snippet::Scope { with struct Scope, it finds it
George Dietrich
@Blacksmoke16
what happens if you rename the struct to like Snippet::Scope2
Taupiqueur
@alexherbo2
Same error
Can it be due to my forwarded block in Walk filter?
George Dietrich
@Blacksmoke16
im not sure
Taupiqueur
@alexherbo2
I haven't found a way to use return like in other filtering methods
mfiano
@mjfiano:matrix.org
[m]
Any Crystal books published yet?
George Dietrich
@Blacksmoke16
one, but it's pre 1.0
mfiano
@mjfiano:matrix.org
[m]
(or WIP)
George Dietrich
@Blacksmoke16
is one that i know of that it's the works at least
mfiano
@mjfiano:matrix.org
[m]
Ah is that mentioned on the homepage somewhere?
George Dietrich
@Blacksmoke16
dont think so
mfiano
@mjfiano:matrix.org
[m]
Ah "Programming Crystal" I take it
George Dietrich
@Blacksmoke16
yea, id prob just wait for the other to come out, as it'll be more up to date and such
mfiano
@mjfiano:matrix.org
[m]
What's this other one?
George Dietrich
@Blacksmoke16
it's WIP atm, but should be out later this year
mfiano
@mjfiano:matrix.org
[m]
Is the name or link still WIP?
George Dietrich
@Blacksmoke16
its still being written so both?
mfiano
@mjfiano:matrix.org
[m]
Ah I see. I suppose it was just mentioned in passing here or the forums then.
George Dietrich
@Blacksmoke16
https://crystal-lang.org/reference/syntax_and_semantics/index.html is also very good if you haven't read thru it yet