-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simple use
example
#4497
base: main
Are you sure you want to change the base?
Add simple use
example
#4497
Conversation
Feels like at this point, it should also be mentioned (or at least referred to) on setting up a module for proper installation, and tools such as |
@lizmat - I certainly get the point of Mi6 ... but I feel that this is a tool for those that want to make a module and that are reading the relevant docs page already - which may be one of these: for example in the and then in the don't know if you watch raku-beginner - I am just taking a whiney person at face value - and yet agreeing that the minimal variant of the '101' somewhere that we chose is actually imo a backwater so this PR is not going to be too helpful to the casual arriver actually calling subs from another file is a bit odd - but I tried to be nice and not push back on that since I know raku is very lightweight for this kind of thing |
@lizmat, I see that I have been unable to convince you that this PR is a standalone minimal example for beginners who care about splitting code over multiple files --- my comment about is to try and separate this PR from the wider wiork that needs doing for package/module docs in general and I believe that referencing how to build a module (with Mi^ or any other way) doesn't belong here I hope that you will come to see that adding in references to "how to build a module" pages reduces the simplicity, brevity and purity of raku in "minimal multi file mode" and urge you to allow this merge forward as written - or at least relent on the basis that the perfect (wider project on improving modules docs) is the enemy of the good (this short response to a newb concern) or, feel free to make changes if you prefer either way, please comment here and I will close this PR either way |
|
||
The C<-I.> directive tells the raku interpreter to look in directory C<.>. | ||
|
||
=begin code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:lang<shell>
so we don't try to compile it
=head1 Calling a raku method from another file | ||
|
||
To call a raku subroutine from another file, the convention is to have a minimal | ||
raku module or class file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To address @lizmat's concern, maybe we can note this is intended to be a simplistic example and point to how to write a module for a more... realistic? larger? example?
The problem
Recently on the Discord beginner channel, a user was confused by the detailed Package / Module features and documentation
Solution provided
Create a minimal example to declare and call a class in an external file in the same dir.