Lab Three Scribble Demo
+ + +Demo of how Scribble works
+ +diff --git a/journal/_src/posts/2022-09-21-lab-four.md b/journal/_src/posts/2022-09-21-lab-four.md new file mode 100644 index 0000000..6ace84a --- /dev/null +++ b/journal/_src/posts/2022-09-21-lab-four.md @@ -0,0 +1,17 @@ + Title: Lab Four + Date: 2022-09-21T08:30:00 + Tags: cs2163, lab, racket, scribble + +In this lab I learned about using functions as values, recursion, scribble, and modules in Racket. + +## Functions as values +You can pass functions as values into other functions which can then be used inside another function, or pass values into said function. This makes it easy to use a function a lot, or build a list of a function for example, with increasing values as its arguments. + +## Recursion +In racket I implemented a factorial function with recursion, and then tested the function to assure that the function is performing correctly. + +## Scribble Demo +I learned how you can use Scribble to use racket in a web page, to programatically generate web content. + +## Modules +I leanned about how to make modules, submodules, testing modules, and a main module. This was shown in a simple program that defined and exported one function called `hello` which simply printed "Hello!" I then used it in another application by using the `require` keyword. I then defined a main module that says when a the hello module is loaded it should print "Hello!" \ No newline at end of file diff --git a/journal/_src/posts/2022-09-21-lab-three-scribble-demo.scrbl b/journal/_src/posts/2022-09-21-lab-three-scribble-demo.scrbl new file mode 100644 index 0000000..8f2e9a7 --- /dev/null +++ b/journal/_src/posts/2022-09-21-lab-three-scribble-demo.scrbl @@ -0,0 +1,14 @@ +#lang scribble/manual + +Title: Lab Three Scribble Demo +Date: 2022-09-21T09:00:00 +Tags: cs2613, lab, racket, scribble + +Demo of how Scribble works + + + +@(define (hello) "hello") +@(define (todo hdr . lst) (list (bold hdr) (apply itemlist (map item lst)))) +@hello{} +@todo["Shopping" "cheese" "fish" "shuriken"] \ No newline at end of file diff --git a/journal/index.html b/journal/index.html index 160224e..3454761 100644 --- a/journal/index.html +++ b/journal/index.html @@ -6,7 +6,7 @@
Demo of how Scribble works
+ +In this lab I learned about using functions as values, recursion, scribble, and modules in Racket.
+ +