Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #2923
| Newsgroups | comp.lang.postscript |
|---|---|
| Date | 2016-10-25 10:32 -0700 |
| References | (10 earlier) <effed4e0-4474-44f0-b9c8-1c28cd17b95c@googlegroups.com> <m2bmyg6ue8.fsf@metalevel.at> <68890a35-ae58-4755-b6be-5f8a7d4b0362@googlegroups.com> <66538ba6-282f-4b3d-b8ba-94b93903385f@googlegroups.com> <nunq2l$cib$1@dont-email.me> |
| Message-ID | <41c5fbb5-a268-4cc1-8522-73f92980ce69@googlegroups.com> (permalink) |
| Subject | Re: Getting Rid Of PostScript |
| From | Lawrence D’Oliveiro <lawrencedo99@gmail.com> |
On Wednesday, October 26, 2016 at 3:26:52 AM UTC+13, Carlos wrote:
>
> On 25/10/2016 1:54, Lawrence D’Oliveiro wrote:
>
>> Note that the actual drawing of a node is implemented by the
>> “draw_node” function which is passed as the argument, while
>> “draw_nodes_grid” itself only implements the layout of the entire
>> diagram.
>
> You can do that in PostScript, too. Pass a block to a procedure, then
> call it with exec.
But you don’t get the lexical binding, which is what really makes them useful.
>> cell_dims = pix.dimensions / Vector(10, 10)
>>>
>> See how the x- and y-dimensions of a single cell are computed from
>> the dimensions of the drawing area by a single division?
>
> Come on. Just because you wrote a vector library in Python and not in
> PostScript, that doesn't make Python better.
You didn’t notice that the operation was done with the standard division operator, then? Python allows you to define custom overloads for the standard operators. This way, you can write your expressions using notation much closer to the original maths.
> assuming pix is a dictionary. Here is the start of a vector library:
>
> /Vector { 2 packedarray } bind def
> /x { 0 get } bind def
> /y { 1 get } bind def
> /xy { aload pop } bind def
>
> /Vop { 3 1 roll
> xy 3 -1 roll xy
> 3 -1 roll 4 index exec
> 3 1 roll exch 3 index exec
> exch Vector
> exch pop } bind def
>
> /Vdiv { { div } Vop } bind def
Not much of a start, don’t you think <https://groups.google.com/d/msg/comp.lang.postscript/fEyXR90-wq4/AsOwYiltBgAJ>?
> Again, a matter of libraries
Which PostScript is, frankly, no help with.
> [Lexical binding is] a facility the Python compiler provides because it's
> otherwise impossible to return custom functions. You don't need the
> interpreter's help in PostScript, because procedures are arrays, and
> you can easily create arrays programmatically. (By the way, this is a
> recurring topic in this newsgroup lately.)
But you cannot do the lexical binding. Not in a reentrant fashion.
> Try this:
How many lines of PostScript code have you written so far? Compare it to how many lines of Python code I needed to write. And your solution isn’t even complete yet.
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar
Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-05 18:24 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-06 14:50 -0700
Re: Getting Rid Of PostScript jdaw1 <jdawiseman@gmail.com> - 2016-10-06 15:45 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-06 17:44 -0700
Re: Getting Rid Of PostScript Mark Carroll <mtbc@bcs.org> - 2016-10-07 08:47 +0100
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-07 15:08 -0700
Re: Getting Rid Of PostScript luser droog <luser.droog@gmail.com> - 2016-10-07 18:47 -0700
Re: Getting Rid Of PostScript Mark Carroll <mtbc@bcs.org> - 2016-10-08 12:34 +0100
Re: Getting Rid Of PostScript luser droog <luser.droog@gmail.com> - 2016-10-07 18:39 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-07 19:07 -0700
Re: Getting Rid Of PostScript luser droog <luser.droog@gmail.com> - 2016-10-12 15:32 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-12 17:06 -0700
Re: Getting Rid Of PostScript rodd@panix.com (Rod Dorman) - 2016-10-13 19:07 +0000
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-13 15:02 -0700
Re: Getting Rid Of PostScript rodd@panix.com (Rod Dorman) - 2016-10-14 20:13 +0000
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-14 14:39 -0700
Re: Getting Rid Of PostScript Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-10-16 10:40 -0600
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-17 18:06 -0700
Re: Getting Rid Of PostScript Alan <alan.isaac@gmail.com> - 2016-10-17 18:44 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-17 22:43 -0700
Re: Getting Rid Of PostScript Martin Leese <please@see.Web.for.e-mail.INVALID> - 2016-10-18 10:13 -0600
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-18 15:28 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-18 15:35 -0700
Re: Getting Rid Of PostScript Ross Presser <rpresser@gmail.com> - 2016-10-18 23:05 -0700
Re: Getting Rid Of PostScript Carlos <angus@quovadis.com.ar> - 2016-10-19 19:23 +0200
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-19 17:17 -0700
Re: Getting Rid Of PostScript Ross Presser <rpresser@gmail.com> - 2016-10-21 09:18 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-21 18:10 -0700
Re: Getting Rid Of PostScript Ross Presser <rpresser@gmail.com> - 2016-10-21 09:14 -0700
Re: Getting Rid Of PostScript Markus Triska <triska@metalevel.at> - 2016-10-19 20:55 +0200
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-19 17:57 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-24 16:54 -0700
Re: Getting Rid Of PostScript Carlos <angus@quovadis.com.ar> - 2016-10-25 16:26 +0200
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-25 10:32 -0700
Re: Getting Rid Of PostScript Carlos <angus@quovadis.com.ar> - 2016-10-25 21:06 +0200
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-11-14 15:15 -0800
Re: Getting Rid Of PostScript Carlos <angus@quovadis.com.ar> - 2016-11-16 00:17 +0100
Re: Getting Rid Of PostScript Carlos <angus@quovadis.com.ar> - 2016-11-21 18:37 +0100
Re: Getting Rid Of PostScript Carlos <angus@quovadis.com.ar> - 2016-11-21 18:39 +0100
Re: Getting Rid Of PostScript Markus Triska <triska@metalevel.at> - 2016-10-25 20:52 +0200
Re: Getting Rid Of PostScript Alan <alan.isaac@gmail.com> - 2016-10-19 16:41 -0700
Re: Getting Rid Of PostScript Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-10-19 17:15 -0700
csiph-web