Apologies for bad formatting: lecture slides etc.

classic Classic list List threaded Threaded
38 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Jonathan Goble
On Wed, Nov 7, 2018 at 8:00 PM Luke <[hidden email]> wrote:
I will buy the e-book. If it does not include exercises / homework
then where might I find that sort of thing?

The latest editions (3rd and 4th, IIRC) of Programming in Lua do include exercises at the end of each chapter.
Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Roberto Ierusalimschy
In reply to this post by Gabriel Bertilson
> It is apparently not a valid number in Lua 5.1 though, where I get a
> syntax error "unexpected symbol near 1e-4". So maybe you're using Lua
> 5.1, not 5.3?

1e-4 is a valid Lua number since day one (version 1.0). Maybe you forgot
the '=' to print it? (Until version 5.2, Lua did not directly read/print
expressions in interactive mode. You have to prefix them with a '='.)

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Gabriel Bertilson
Oops, you're right, I did forget to add an equals sign. 😔 Sorry for
spreading misinformation.

— Gabriel



On Thu, Nov 8, 2018 at 5:39 AM Roberto Ierusalimschy
<[hidden email]> wrote:

>
> > It is apparently not a valid number in Lua 5.1 though, where I get a
> > syntax error "unexpected symbol near 1e-4". So maybe you're using Lua
> > 5.1, not 5.3?
>
> 1e-4 is a valid Lua number since day one (version 1.0). Maybe you forgot
> the '=' to print it? (Until version 5.2, Lua did not directly read/print
> expressions in interactive mode. You have to prefix them with a '='.)
>
> -- Roberto
>

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Luke
Working through the lecture notes again, for now, I can buy the e-book shortly.

> Think of map as a function maker.
After making the function, the job of map is done.

Is the function passed to map by square a callback? Or not, perhaps because it is not a parameter of map, or perhaps map does not call the function?

function map(f)
return function (l)
  local nl = {}
  for i, x in ipairs(l) do
  nl[i] = f(x)
  end
  return nl
  end
end
square = map(function (x) return x * x end)
print(table.unpack(square{ 1, 5, 9 }))
Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Luke
In reply to this post by Jonathan Goble
> exercises

I'm guessing no glossary then. That's a shame, they are useful
additions to an introduction to anything. e.g. there is no definition
of 'seed' in the lua glosasry linked to, wikipedia, or my dictionary

Perhaps these questions are too genetic, however.

Luke

On Thu, 8 Nov 2018 at 01:04, Jonathan Goble <[hidden email]> wrote:
>
> On Wed, Nov 7, 2018 at 8:00 PM Luke <[hidden email]> wrote:
>>
>> I will buy the e-book. If it does not include exercises / homework
>> then where might I find that sort of thing?
>
>
> The latest editions (3rd and 4th, IIRC) of Programming in Lua do include exercises at the end of each chapter.

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Dirk Laurie-2
Op Vr., 9 Nov. 2018 om 02:11 het Luke <[hidden email]> geskryf:

> I'm guessing no glossary then. That's a shame, they are useful
> additions to an introduction to anything. e.g. there is no definition
> of 'seed' in the lua glosasry linked to, wikipedia, or my dictionary

There is an unofficial glossary, dealing mostly with background
knowledge that the reader of the offficial documentation is assumed
to, but does not always, have. "It does not cover advanced concepts."
I'm afraid that "seed", depending as it does on "pseudo-random" , has
so far fallen in that category.

https://rawgit.com/dlaurie/lua-notes/master/glossary.html

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Luke
That's a shame.

Are these "advanced concepts" difficult to learn or do they just
depend on handful of other terms? Seed was in the lectures' definition
of fold, and then the next slide confused confused me further:

     A curried function is a function that, instead of taking all of
its parameters at once, takes a proper prefix of them and then returns
a (possibly also curried) function that takes the rest of the
parameters; for example, the following is curried version of map

But I believe that map never takes any parameters other than the
function it is called with: square builds a new function from a map
function that never sees the table. I am a graduate, and am used to
slightly vague slides that need filling in by the lecturer. And I'm
not complaining! Free stuff is good just feel like something is
missing. I said the same for ubuntu!

Cheers,
Luke
On Fri, 9 Nov 2018 at 03:31, Dirk Laurie <[hidden email]> wrote:

>
> Op Vr., 9 Nov. 2018 om 02:11 het Luke <[hidden email]> geskryf:
>
> > I'm guessing no glossary then. That's a shame, they are useful
> > additions to an introduction to anything. e.g. there is no definition
> > of 'seed' in the lua glosasry linked to, wikipedia, or my dictionary
>
> There is an unofficial glossary, dealing mostly with background
> knowledge that the reader of the offficial documentation is assumed
> to, but does not always, have. "It does not cover advanced concepts."
> I'm afraid that "seed", depending as it does on "pseudo-random" , has
> so far fallen in that category.
>
> https://rawgit.com/dlaurie/lua-notes/master/glossary.html
>

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Sean Conner
It was thus said that the Great Luke once stated:
> That's a shame.
>
> Are these "advanced concepts" difficult to learn or do they just
> depend on handful of other terms? Seed was in the lectures' definition
> of fold, and then the next slide confused confused me further:

  Some, like "map" or "fold", are not difficult but depend upon other concepts;
others like "monad" are so opaque as to defy definition (a monad is just a
monoid in the category of endofunctors, or so I'm told, but I'm not a
mathematician or type theorist).

> But I believe that map never takes any parameters other than the
> function it is called with: square builds a new function from a map
> function that never sees the table.

  Maybe "a" particular implementation of map() will do that, but not all.
In general, you have three related concepts:  map, filter, reduce (or fold).

        map: maps a list of values to new values, for instance:

                x = { 1 , 2 , 3 , 4}
                y = map(x,function(x) return x * x end)
                -- y has { 1 , 4 , 9 , 16 }

        filter: filters out values that fit some criteria into a new list.

                y = filter(x,function(x) return x % 2 == 0 end)
                -- y has { 2 , 4 }

        reduce (aka fold): maps a list of values to a single result, such
               as the sum of all items:

                y = reduce(x,function(a,b) return a + b end)
                -- y is now 10

  The think to keep in mind is that in general, map() need not work "left to
right" (it can do it right to left, or all at the same time, etc.).
reduce() will usually go "left to right" and if you need the opposite
direction, there might be a reducer() function; filter works simularly, but
as always, check the manual before using.

  Also, every instance I've seen (in other langauges; other implementations)
map() will also always take the data and a function to run over the items;
same for filter() and reduce().

  -spc (Remember, the meanings behind these terms will come in time,
        except for monads ... )

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Luke
> t was thus said that the Great Luke once stated

What, I'm just giving on opinion on what learning lua is like...
there's really no need to be rude at all

Luke
On Fri, 9 Nov 2018 at 19:07, Sean Conner <[hidden email]> wrote:

>
> It was thus said that the Great Luke once stated:
> > That's a shame.
> >
> > Are these "advanced concepts" difficult to learn or do they just
> > depend on handful of other terms? Seed was in the lectures' definition
> > of fold, and then the next slide confused confused me further:
>
>   Some, like "map" or "fold", are not difficult but depend upon other concepts;
> others like "monad" are so opaque as to defy definition (a monad is just a
> monoid in the category of endofunctors, or so I'm told, but I'm not a
> mathematician or type theorist).
>
> > But I believe that map never takes any parameters other than the
> > function it is called with: square builds a new function from a map
> > function that never sees the table.
>
>   Maybe "a" particular implementation of map() will do that, but not all.
> In general, you have three related concepts:  map, filter, reduce (or fold).
>
>         map: maps a list of values to new values, for instance:
>
>                 x = { 1 , 2 , 3 , 4}
>                 y = map(x,function(x) return x * x end)
>                 -- y has { 1 , 4 , 9 , 16 }
>
>         filter: filters out values that fit some criteria into a new list.
>
>                 y = filter(x,function(x) return x % 2 == 0 end)
>                 -- y has { 2 , 4 }
>
>         reduce (aka fold): maps a list of values to a single result, such
>                as the sum of all items:
>
>                 y = reduce(x,function(a,b) return a + b end)
>                 -- y is now 10
>
>   The think to keep in mind is that in general, map() need not work "left to
> right" (it can do it right to left, or all at the same time, etc.).
> reduce() will usually go "left to right" and if you need the opposite
> direction, there might be a reducer() function; filter works simularly, but
> as always, check the manual before using.
>
>   Also, every instance I've seen (in other langauges; other implementations)
> map() will also always take the data and a function to run over the items;
> same for filter() and reduce().
>
>   -spc (Remember, the meanings behind these terms will come in time,
>         except for monads ... )
>

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Luke
My expertise is in not being as clever as everyone else. There's no
need to take that personally!
On Fri, 9 Nov 2018 at 19:19, Luke <[hidden email]> wrote:

>
> > t was thus said that the Great Luke once stated
>
> What, I'm just giving on opinion on what learning lua is like...
> there's really no need to be rude at all
>
> Luke
> On Fri, 9 Nov 2018 at 19:07, Sean Conner <[hidden email]> wrote:
> >
> > It was thus said that the Great Luke once stated:
> > > That's a shame.
> > >
> > > Are these "advanced concepts" difficult to learn or do they just
> > > depend on handful of other terms? Seed was in the lectures' definition
> > > of fold, and then the next slide confused confused me further:
> >
> >   Some, like "map" or "fold", are not difficult but depend upon other concepts;
> > others like "monad" are so opaque as to defy definition (a monad is just a
> > monoid in the category of endofunctors, or so I'm told, but I'm not a
> > mathematician or type theorist).
> >
> > > But I believe that map never takes any parameters other than the
> > > function it is called with: square builds a new function from a map
> > > function that never sees the table.
> >
> >   Maybe "a" particular implementation of map() will do that, but not all.
> > In general, you have three related concepts:  map, filter, reduce (or fold).
> >
> >         map: maps a list of values to new values, for instance:
> >
> >                 x = { 1 , 2 , 3 , 4}
> >                 y = map(x,function(x) return x * x end)
> >                 -- y has { 1 , 4 , 9 , 16 }
> >
> >         filter: filters out values that fit some criteria into a new list.
> >
> >                 y = filter(x,function(x) return x % 2 == 0 end)
> >                 -- y has { 2 , 4 }
> >
> >         reduce (aka fold): maps a list of values to a single result, such
> >                as the sum of all items:
> >
> >                 y = reduce(x,function(a,b) return a + b end)
> >                 -- y is now 10
> >
> >   The think to keep in mind is that in general, map() need not work "left to
> > right" (it can do it right to left, or all at the same time, etc.).
> > reduce() will usually go "left to right" and if you need the opposite
> > direction, there might be a reducer() function; filter works simularly, but
> > as always, check the manual before using.
> >
> >   Also, every instance I've seen (in other langauges; other implementations)
> > map() will also always take the data and a function to run over the items;
> > same for filter() and reduce().
> >
> >   -spc (Remember, the meanings behind these terms will come in time,
> >         except for monads ... )
> >

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Luke
Those weren't ironic quotes, and, while I appreciate the reply, I took
it personally.
On Fri, 9 Nov 2018 at 19:21, Luke <[hidden email]> wrote:

>
> My expertise is in not being as clever as everyone else. There's no
> need to take that personally!
> On Fri, 9 Nov 2018 at 19:19, Luke <[hidden email]> wrote:
> >
> > > t was thus said that the Great Luke once stated
> >
> > What, I'm just giving on opinion on what learning lua is like...
> > there's really no need to be rude at all
> >
> > Luke
> > On Fri, 9 Nov 2018 at 19:07, Sean Conner <[hidden email]> wrote:
> > >
> > > It was thus said that the Great Luke once stated:
> > > > That's a shame.
> > > >
> > > > Are these "advanced concepts" difficult to learn or do they just
> > > > depend on handful of other terms? Seed was in the lectures' definition
> > > > of fold, and then the next slide confused confused me further:
> > >
> > >   Some, like "map" or "fold", are not difficult but depend upon other concepts;
> > > others like "monad" are so opaque as to defy definition (a monad is just a
> > > monoid in the category of endofunctors, or so I'm told, but I'm not a
> > > mathematician or type theorist).
> > >
> > > > But I believe that map never takes any parameters other than the
> > > > function it is called with: square builds a new function from a map
> > > > function that never sees the table.
> > >
> > >   Maybe "a" particular implementation of map() will do that, but not all.
> > > In general, you have three related concepts:  map, filter, reduce (or fold).
> > >
> > >         map: maps a list of values to new values, for instance:
> > >
> > >                 x = { 1 , 2 , 3 , 4}
> > >                 y = map(x,function(x) return x * x end)
> > >                 -- y has { 1 , 4 , 9 , 16 }
> > >
> > >         filter: filters out values that fit some criteria into a new list.
> > >
> > >                 y = filter(x,function(x) return x % 2 == 0 end)
> > >                 -- y has { 2 , 4 }
> > >
> > >         reduce (aka fold): maps a list of values to a single result, such
> > >                as the sum of all items:
> > >
> > >                 y = reduce(x,function(a,b) return a + b end)
> > >                 -- y is now 10
> > >
> > >   The think to keep in mind is that in general, map() need not work "left to
> > > right" (it can do it right to left, or all at the same time, etc.).
> > > reduce() will usually go "left to right" and if you need the opposite
> > > direction, there might be a reducer() function; filter works simularly, but
> > > as always, check the manual before using.
> > >
> > >   Also, every instance I've seen (in other langauges; other implementations)
> > > map() will also always take the data and a function to run over the items;
> > > same for filter() and reduce().
> > >
> > >   -spc (Remember, the meanings behind these terms will come in time,
> > >         except for monads ... )
> > >

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Luke
No apology. Perhaps I'm too chatty, as well as very badly organized.

Apologies then, and good luck with your programming things :) I'm out

Luke

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Coda Highland
On Fri, Nov 9, 2018 at 1:31 PM Luke <[hidden email]> wrote:
>
> No apology. Perhaps I'm too chatty, as well as very badly organized.
>
> Apologies then, and good luck with your programming things :) I'm out
>
> Luke
>

That was just Sean's default reply header. It's in almost all of his
emails. Not sarcastic, not deprecating, and not even consciously done.
It's just a little more interesting than "Luke wrote:".

/s/ Adam

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Sean Conner
It was thus said that the Great Coda Highland once stated:

> On Fri, Nov 9, 2018 at 1:31 PM Luke <[hidden email]> wrote:
> >
> > No apology. Perhaps I'm too chatty, as well as very badly organized.
> >
> > Apologies then, and good luck with your programming things :) I'm out
> >
> > Luke
> >
>
> That was just Sean's default reply header. It's in almost all of his
> emails. Not sarcastic, not deprecating, and not even consciously done.
> It's just a little more interesting than "Luke wrote:".

  I've had that reply header since 1994.  I'm not sure why now (and only on
this mailing list) that I'm getting complaints.  Perhaps it's how I replied?

  -spc (Although when I first set it, it said "A long long time ago on a
        network far far away, The Great %s wrote:")

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Robert Raschke
Times change, and what was once interpreted as flippant, is no longer so.

There's been a few instances now where people interpreted that intro reply line as condescending, so maybe it's time to change it?

Cheers, 
Robby


On Fri, 9 Nov 2018 22:18 Sean Conner, <[hidden email]> wrote:
It was thus said that the Great Coda Highland once stated:
> On Fri, Nov 9, 2018 at 1:31 PM Luke <[hidden email]> wrote:
> >
> > No apology. Perhaps I'm too chatty, as well as very badly organized.
> >
> > Apologies then, and good luck with your programming things :) I'm out
> >
> > Luke
> >
>
> That was just Sean's default reply header. It's in almost all of his
> emails. Not sarcastic, not deprecating, and not even consciously done.
> It's just a little more interesting than "Luke wrote:".

  I've had that reply header since 1994.  I'm not sure why now (and only on
this mailing list) that I'm getting complaints.  Perhaps it's how I replied?

  -spc (Although when I first set it, it said "A long long time ago on a
        network far far away, The Great %s wrote:")

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Dirk Laurie-2
Op Sa., 10 Nov. 2018 om 09:51 het Robert Raschke
<[hidden email]> geskryf:
>
> Times change, and what was once interpreted as flippant, is no longer so.
>
> There's been a few instances now where people interpreted that intro reply line as condescending, so maybe it's time to change it?

The complaints come only from newcomers who have joined and posted
without first reading a day or two's worth of previous posts.

Part of what gives any list its particular flavour is precisely the
mildly eccentric habits of its regulars. The onus is on the newcomer
to become familiar with what we say and how we say it. It goes much
deeper than just a few automatic headers and .sigs.

I do not agree that old-timers on the list should change their ways
because newcomers don't understand them. I would personally regret
much more the fed-up departure of an old-timer [1] than the huffy exit
of a newbie.

[1] When last did we see a post by —, — or  —?

Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Tim Hill


> On Nov 10, 2018, at 1:25 AM, Dirk Laurie <[hidden email]> wrote:
>
> Op Sa., 10 Nov. 2018 om 09:51 het Robert Raschke
> <[hidden email]> geskryf:
>>
>> Times change, and what was once interpreted as flippant, is no longer so.
>>
>> There's been a few instances now where people interpreted that intro reply line as condescending, so maybe it's time to change it?
>
> The complaints come only from newcomers who have joined and posted
> without first reading a day or two's worth of previous posts.
>
> Part of what gives any list its particular flavour is precisely the
> mildly eccentric habits of its regulars. The onus is on the newcomer
> to become familiar with what we say and how we say it. It goes much
> deeper than just a few automatic headers and .sigs.
>
> I do not agree that old-timers on the list should change their ways
> because newcomers don't understand them. I would personally regret
> much more the fed-up departure of an old-timer [1] than the huffy exit
> of a newbie.
>
> [1] When last did we see a post by —, — or  —?
>

+1 .. it’s a mild and amusing way to start a quote .. no-one should be offended by it, and if they are, well, perhaps they should reflect on that for a while.

—Tim


Reply | Threaded
Open this post in threaded view
|

Re: Apologies for bad formatting: lecture slides etc.

Lorenzo Donati-3
In reply to this post by Sean Conner
On 09/11/2018 22:18, Sean Conner wrote:

> It was thus said that the Great Coda Highland once stated:
>> On Fri, Nov 9, 2018 at 1:31 PM Luke <[hidden email]> wrote:
>>>
>>> No apology. Perhaps I'm too chatty, as well as very badly organized.
>>>
>>> Apologies then, and good luck with your programming things :) I'm out
>>>
>>> Luke
>>>
>>
>> That was just Sean's default reply header. It's in almost all of his
>> emails. Not sarcastic, not deprecating, and not even consciously done.
>> It's just a little more interesting than "Luke wrote:".
>
>   I've had that reply header since 1994.  I'm not sure why now (and only on
> this mailing list) that I'm getting complaints.  Perhaps it's how I replied?
>

It might be perceived as sarcastic only by people that didn't read
enough of past mailing list messages of yours.

Once upon a time (<wink>) people followed good netiquette and lurked for
a while on a mailing list or a forum before posting anything: the
ancient lore told that not doing so was rude against the deities of the
sacred net. And daemons could be freed from their ancient prisons had
not that ritual been followed! :-D

But nowadays all has changed: people rush in the room without even
bothering to know who's who and they require everyone to give them
whatever they want, not even thanking for it <"gimmeee the codeeez!">
(BTW, I'm not saying that this is the OP's attitude).

Linguistic barrier could also be a problem, non-native speakers might
not recognize that "ancient speak" nuance of the opening. But, again, a
decent dose of lurking should convince anyone at least that that is just
boilerplate text, not meant to belittle anyone.

BTW, I was always amused by that opening: It's like a character from
Tolkien or Shakespeare is about to jump out from the darkness and take
life while reading your posts :-)


>   -spc (Although when I first set it, it said "A long long time ago on a
> network far far away, The Great %s wrote:")
>
>

May the force be with you! :-D


12