feat: replace placeholder core-libraries doc with full core-library reference and refine site design

Replace the empty `core-libraries.markdown` placeholder with a comprehensive `core-library.markdown` documenting Object, Class, Bool, and Fiber classes. Update site template to link to the new page. Tweak SCSS styles: reduce body font to 16px/25px, darken header background with text-shadow, adjust code font size and borders, add left margin to main content paragraphs and pre blocks, and refine link colors. Fix prose in functions.markdown to use "arguments" instead of "parameters" and clarify dynamic dispatch wording.
This commit is contained in:
Bob Nystrom
2014-08-24 16:09:10 +00:00
parent 235518637a
commit ee05fb67b0
5 changed files with 342 additions and 21 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ Once you have a function, how do you invoke it? Like everything in Wren, you do
}
}
Functions expose a `call` method that executes the body of the function. Of course, this is dynamically-dispatched like other methods, so you can define your own "function-like" classes and pass them to methods that expect real functions.
Functions expose a `call` method that executes the body of the function. This method is dynamically-dispatched like any other, so you can define your own "function-like" classes and pass them to methods that expect "real" functions.
:::dart
class FakeFn {
@@ -73,7 +73,7 @@ Functions expose a `call` method that executes the body of the function. Of cour
## Function parameters
Of course, functions aren't very useful if you can't pass values to them. The functions that we've seen so far take no parameters. To change that, you can provide a parameter list surrounded by `|` immediately after the opening brace of the body, like so:
Of course, functions aren't very useful if you can't pass values to them. The functions that we've seen so far take no arguments. To change that, you can provide a parameter list surrounded by `|` immediately after the opening brace of the body, like so:
:::dart
blondie.callMe {|first, last|