From: ·······@cad.strath.ac.uk
Subject: How to take out h and v value in #_Lineto?
Date:
Message-ID: <8utn0p$qfl$1@nnrp1.deja.com>
Hello,
I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
as
(#_lineto (point-h where) (point-v where))
() ; take out point-h and point-v
(setf first-x point-h)
(setf first-y point-v)
However, in the definition, #_lineto does not return any value.
How can I get the h and v coordinates?
Sungwoo
Sent via Deja.com http://www.deja.com/
Before you buy.
In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk
wrote:
> Hello,
>
> I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
> as
I don't fully understand the question...
> (#_lineto (point-h where) (point-v where))
> () ; take out point-h and point-v
> (setf first-x point-h)
> (setf first-y point-v)
>
> However, in the definition, #_lineto does not return any value.
Why should LineTo return a value? What value?
> How can I get the h and v coordinates?
You already have the point WHERE - so why don't get
you get it from there?
> Sungwoo
The value of WHERE is a point, yes?
(point-h where) returns the horizontal component of the point.
(point-v where) returns the vertical component of the point.
--
Rainer Joswig, Hamburg, Germany
Email: ·············@corporate-world.lisp.de
Web: http://corporate-world.lisp.de/
In article <····························@news.is-europe.net>,
Rainer Joswig <······@corporate-world.lisp.de> wrote:
> In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk
> wrote:
>
> > Hello,
> >
> > I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
> > as
>
> I don't fully understand the question...
>
> > (#_lineto (point-h where) (point-v where))
> > () ; take out point-h and point-v
> > (setf first-x point-h)
> > (setf first-y point-v)
> >
> > However, in the definition, #_lineto does not return any value.
>
> Why should LineTo return a value? What value?
>
> > How can I get the h and v coordinates?
>
> You already have the point WHERE - so why don't get
> you get it from there?
>
> > Sungwoo
>
> The value of WHERE is a point, yes?
>
> (point-h where) returns the horizontal component of the point.
> (point-v where) returns the vertical component of the point.
>
> --
> Rainer Joswig, Hamburg, Germany
> Email: ·············@corporate-world.lisp.de
> Web: http://corporate-world.lisp.de/
>
I was fully silly.
I thought the point-h and point-v are points rather than (point-h where).
That's why I couldn't get the result at all.
After changed like below, now it works. =)
(#_lineto (point-h pos) (point-v pos))
(setf next-x (point-h pos))
(setf next-y (point-v pos))
Thanks alot.
Sungwoo
Sent via Deja.com http://www.deja.com/
Before you buy.
In article <·············@my-deja.com>,
······@my-deja.com wrote:
> ·······@cad.strath.ac.uk wrote:
> >
> [snip]
> > In article <····························@news.is-europe.net>,
> > After changed like below, now it works. =)
> >
> > (#_lineto (point-h pos) (point-v pos))
> > (setf next-x (point-h pos))
> > (setf next-y (point-v pos))
> >
>
> Might I recommend instead
>
> (setf next-x (point-h pos))
> (setf next-y (point-v pos))
> (#_lineto next-x next-y)
>
> Cheers,
> John
>
I see.... that code seems much optimsed for performance...
For a small sketching behaviour, I can't measure how much increase the speed.
but maybe I can realise the difference with complex sketches and tasks....?
Can this code save some memory as well or not?
(or,,, maybe I don't have to worry about the memory usage?)
I don't know exactly what will be different between two coding type. (Plz
remember, I am a newbie. =)) Would you let me know the difference (speed or
memory or something else..)?
Sungwoo
Sent via Deja.com http://www.deja.com/
Before you buy.
In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk
wrote:
> In article <·············@my-deja.com>,
> ······@my-deja.com wrote:
> > ·······@cad.strath.ac.uk wrote:
> > >
> > [snip]
> > > In article <····························@news.is-europe.net>,
> > > After changed like below, now it works. =)
> > >
> > > (#_lineto (point-h pos) (point-v pos))
> > > (setf next-x (point-h pos))
> > > (setf next-y (point-v pos))
> > >
> >
> > Might I recommend instead
> >
> > (setf next-x (point-h pos))
> > (setf next-y (point-v pos))
> > (#_lineto next-x next-y)
> >
> > Cheers,
> > John
> >
>
> I see.... that code seems much optimsed for performance...
> For a small sketching behaviour, I can't measure how much increase the speed.
> but maybe I can realise the difference with complex sketches and tasks....?
> Can this code save some memory as well or not?
> (or,,, maybe I don't have to worry about the memory usage?)
>
> I don't know exactly what will be different between two coding type. (Plz
> remember, I am a newbie. =)) Would you let me know the difference (speed or
> memory or something else..)?
It doesn't matter that much.
You can also do:
> > (setf next-x (point-h pos))
> > (setf next-y (point-v pos))
> > (#_lineto next-x next-y)
>
(#_lineto (setf next-x (point-h pos))
(setf next-y (point-v pos)))
Most of the time you won't see any difference. So forget
about it for now.
--
Rainer Joswig, Hamburg, Germany
Email: ·············@corporate-world.lisp.de
Web: http://corporate-world.lisp.de/
In article <····························@news.is-europe.net>,
Rainer Joswig <······@corporate-world.lisp.de> wrote:
> In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk
> wrote:
>
> > In article <·············@my-deja.com>,
> > ······@my-deja.com wrote:
> > > ·······@cad.strath.ac.uk wrote:
> > > >
> > > [snip]
> > > > In article <····························@news.is-europe.net>,
> > > > After changed like below, now it works. =)
> > > >
> > > > (#_lineto (point-h pos) (point-v pos))
> > > > (setf next-x (point-h pos))
> > > > (setf next-y (point-v pos))
> > > >
> > >
> > > Might I recommend instead
> > >
> > > (setf next-x (point-h pos))
> > > (setf next-y (point-v pos))
> > > (#_lineto next-x next-y)
> > >
> > > Cheers,
> > > John
> > >
> >
> > I see.... that code seems much optimsed for performance...
> > For a small sketching behaviour, I can't measure how much increase the speed.
> > but maybe I can realise the difference with complex sketches and tasks....?
> > Can this code save some memory as well or not?
> > (or,,, maybe I don't have to worry about the memory usage?)
> >
> > I don't know exactly what will be different between two coding type. (Plz
> > remember, I am a newbie. =)) Would you let me know the difference (speed or
> > memory or something else..)?
>
> It doesn't matter that much.
>
> You can also do:
>
> > > (setf next-x (point-h pos))
> > > (setf next-y (point-v pos))
> > > (#_lineto next-x next-y)
> >
>
> (#_lineto (setf next-x (point-h pos))
> (setf next-y (point-v pos)))
>
> Most of the time you won't see any difference. So forget
> about it for now.
>
> --
> Rainer Joswig, Hamburg, Germany
> Email: ·············@corporate-world.lisp.de
> Web: http://corporate-world.lisp.de/
>
I see. Thanks alot, =)
Sungwoo
Sent via Deja.com http://www.deja.com/
Before you buy.
In article <············@nnrp1.deja.com>, ·······@cad.strath.ac.uk wrote:
> I am trying to get a value of h and v in #_lineto (MCL's quickdraw function)
> as
>
> (#_lineto (point-h where) (point-v where))
> () ; take out point-h and point-v
> (setf first-x point-h)
> (setf first-y point-v)
>
> However, in the definition, #_lineto does not return any value.
> How can I get the h and v coordinates?
???
(#_lineto h v) draws a line from the point whereever the pen was
located before to the point you specify with h and v, and leaves
the pen at ·@(h v) afterwards.
(progn
(#_moveto 0 0) ; move the pen without drawing
(#_lineto 100 100))
Above code draws a line from ·@(0 0) to ·@(100 100).
abe