Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #46984

Re: "pattern matching as inverting functions" for "languages without named parameters"

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.forth
Subject Re: "pattern matching as inverting functions" for "languages without named parameters"
Date Sat, 07 May 2016 17:51:29 -0700
Organization A noiseless patient Spider
Lines 13
Message-ID <87shxt74oe.fsf@jester.gateway.pace.com> (permalink)
References <fefae4e1-f4e0-40ed-b668-4071310ac798@googlegroups.com> <2016May6.165650@mips.complang.tuwien.ac.at> <2016May6.183555@mips.complang.tuwien.ac.at> <878tzncf2v.fsf@nightsong.com> <2016May7.155757@mips.complang.tuwien.ac.at>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="6f8cc70e6892455e89d230a40ec2704b"; logging-data="2786"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZJ9srhHWFUr/udPriGgJP"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:ykFhZ5a0z5fhbXXd7uIprUl5VNc= sha1:rCHBEzFlAk+HczbMXwolwXZwwC4=
Xref csiph.com comp.lang.forth:46984

Show key headers only | View raw


anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>>Lisp and Python have features like that
> Can you present an example use that cannot be solved with same-length
> or shorter programs with OOP or higher-order words?

It's used all the time, e.g. the Python equivalent of the Forth word
/MOD is the divmod function:

   quotient, remainder = divmod(num, divisor)

divmod returns a pair, and in that example I bound the two elements
of the pair into 'quotient' and 'remainder' through destructuring
(that's the Lisp term, I don't remember if there's a Python term).

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

"pattern matching as inverting functions" for "languages without named parameters" Andreas Wagner <andreas.wagner@lowfatcomputing.org> - 2016-05-03 11:24 -0700
  Re: "pattern matching as inverting functions" for "languages without named parameters" Andreas Wagner <andreas.wagner@lowfatcomputing.org> - 2016-05-03 11:42 -0700
  Re: "pattern matching as inverting functions" for "languages without named parameters" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-06 14:56 +0000
    Re: "pattern matching as inverting functions" for "languages without named parameters" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-06 16:35 +0000
      Re: "pattern matching as inverting functions" for "languages without named parameters" Paul Rubin <no.email@nospam.invalid> - 2016-05-06 09:43 -0700
        Re: "pattern matching as inverting functions" for "languages without named parameters" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-07 13:57 +0000
          Re: "pattern matching as inverting functions" for "languages without named parameters" Paul Rubin <no.email@nospam.invalid> - 2016-05-07 17:51 -0700
            Re: "pattern matching as inverting functions" for "languages without named parameters" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-08 14:02 +0000
    Re: "pattern matching as inverting functions" for "languages without named parameters" "WJ" <w_a_x_man@yahoo.com> - 2016-05-07 14:51 +0000

csiph-web