Functions are Objects | Week 4 | 18.S191 MIT Fall 2020

preview_player
Показать описание

Contents
0:00 Functions are Objects
0:35 Example: rename a function
1:11 Example: array of functions
2:02 Functions as arguments to another function
2:58 Functional programming: map and filter
3:30 Filter function
4:50 Filter function with anonymous function
5:16 Filter function with do block
5:57 Map function
6:47 Importance of different syntax styles

Рекомендации по теме
Комментарии
Автор

Every time I see/use Pluto I realize how awesome it is to code using it.

SubhadityaMukherjee
Автор

Thank You for the Julia Functional Programming video, you rock ! And indeed it IS much easier to read f(g(h(x))) than several for loops depending on vector or pointer (re)initializations over iterators etc.

marccox
Автор

Another useful function in this regard is reduce().

lordecircojeca
Автор

piping map and filter would be an eye opener imho.. might be too early for students just started to learn programming but still it's quite valuable.. when you learn to pipe (or chain) and it's up to your imagination regards to length, components and composition of a chain.. So, "filter(x->x.age > 7, data) |> f->map(x->x.photo, f)" would be perfect at the end..

AlperYilmaz
Автор

Interesting, seams to me the way we code in R with tidyverse. I'm really interested in leaning Julia.

igordemetriusalencar
Автор

Great video. But your microphone is clipping, maybe turn the volume of the mic down a little in OBS?

DrBenVincent
Автор

I suppose it's just a stylistic question, but when do you choose map/filter over a comprehension?

tristanreid
Автор

And I like Underscores.jl version: @_ filter(_.age > 7, data)

SkofferFly
Автор

Is it possible to have multiple "do" blocks? Let's say my function accepts 2 function parameters and I want to pass in two anonymous block (multiline) functions. Does Julia support this?

ArrowRaider
Автор

2:23 What is the shortcut for sending the "end" keyword all the way to the left?

enisten
Автор

OK, but none of that relied on functions being *objects*, just functions being values.

jursamaj
visit shbcf.ru