Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

We *need* this op! :-)

5 views
Skip to first unread message

Jos Visser

unread,
Aug 7, 2003, 11:21:11 AM8/7/03
to Perl6 Internals (parrot)
Accompanying patch adds the "fortytwo" op to Parrot, so the following
PASM becomes legal:

fortytwo I0
print I0
print "\n"
end

Example:

$ ../parrot test42.pasm
42

Sorry, could not resist. :-)

++Jos.es

--
ek is so lug jy vlieg deur my
sonder jou is ek sonder patroon
"Breyten Breytenbach"

aap

Nicholas Clark

unread,
Aug 7, 2003, 11:28:06 AM8/7/03
to Jos Visser, Perl6 Internals (parrot)
On Thu, Aug 07, 2003 at 05:21:11PM +0200, Jos Visser wrote:
> Accompanying patch adds the "fortytwo" op to Parrot, so the following
> PASM becomes legal:
>
> fortytwo I0
> print I0
> print "\n"
> end
>
> Example:
>
> $ ../parrot test42.pasm
> 42
>
> Sorry, could not resist. :-)

Shouldn't it be the what_do_you_get_if_you_multiply_six_by_nine op?

Nicholas Clark

Simon Glover

unread,
Aug 7, 2003, 11:30:44 AM8/7/03
to Jos Visser, Perl6 Internals (parrot)

On Thu, 7 Aug 2003, Jos Visser wrote:

> Accompanying patch adds the "fortytwo" op to Parrot, so the following
> PASM becomes legal:
>
> fortytwo I0
> print I0
> print "\n"
> end
>
> Example:
>
> $ ../parrot test42.pasm
> 42
>

Why not just use a macro?

# .macro fortytwo (A)
# set .A, 42
# .endm
#
# .fortytwo(I0)
# print I0
# print "\n"
# end


Simon

Kay Roepke

unread,
Aug 7, 2003, 11:54:36 AM8/7/03
to Simon Glover, Jos Visser, Perl6 Internals (parrot)
Simon Glover wrote:

>Why not just use a macro?
>
># .macro fortytwo (A)
># set .A, 42
># .endm
>#
># .fortytwo(I0)
># print I0
># print "\n"
># end
>
>
> Simon
>

Shouldn't be The Answer a builtin?

Kay


Gordon Henriksen

unread,
Aug 7, 2003, 12:57:11 PM8/7/03
to Jos Visser, Perl6 Internals (parrot)
This is really a language feature; you should add it to the hq9+
implementation.

--

Gordon Henriksen
IT Manager
ICLUBcentral Inc.
gor...@iclub.com

Leopold Toetsch

unread,
Aug 7, 2003, 12:45:06 PM8/7/03
to Jos Visser, perl6-i...@perl.org
Jos Visser <jo...@osp.nl> wrote:

> Accompanying patch adds the "fortytwo" op to Parrot, so the following
> PASM becomes legal:

> fortytwo I0

Pah, we need my dynpmc patch:

load_pmc "foo", P0
new P0, .Foo
set I0, P0


print I0
print "\n"
end

42

SCNR2
leo

Leopold Toetsch

unread,
Aug 7, 2003, 1:41:29 PM8/7/03
to Nicholas Clark, Jos Visser, Perl6 Internals (parrot)
Nicholas Clark wrote:

> On Thu, Aug 07, 2003 at 05:21:11PM +0200, Jos Visser wrote:

>> fortytwo I0


>
> Shouldn't it be the what_do_you_get_if_you_multiply_six_by_nine op?

Shouldn't it be the

what_do_you_get_if_you_multiply_six_by_nine_then_subtract_twelve op?


> Nicholas Clark

SCNR2, leo


Garrett Goebel

unread,
Aug 7, 2003, 2:42:24 PM8/7/03
to Leopold Toetsch, Nicholas Clark, Jos Visser, Perl6 Internals (parrot)
Leopold Toetsch wrote:

> Nicholas Clark wrote:
> > Jos Visser wrote:
> >> fortytwo I0
> >
> > Shouldn't it be the what_do_you_get_if_you_multiply_six_by_nine op?
>
> Shouldn't it be the
> what_do_you_get_if_you_multiply_six_by_nine_then_subtract_twelve op?

Just for those people who've missed the reference:

cribbed from: http://www.mac-2001.com/42/42.htm

Approximately 16 million years ago, pan-dimensional
beings constructed the second-most powerful computer
of all time and space to calculate the GREAT ANSWER
to the GREAT QUESTION

The great question of Life, the Universe, Everything.

(to which such trivial questions of: Why? and How?
and When's tea time? -- are but simply a part).

After Seven-and-a-half MILLION YEARS, the great
computer (which was known as "Deep Thought")
came up with the answer...

The two master philosophers approach Deep Thought...

They ask:

Are you ready?

Yes

You mean there's actually an answer?

Yes

A simple answer, that we can understand?

Yes. But, you're not going to like this.


That's fine, just tell us.


Yes, the answer to the great question is...


Yes, yes...


The answer to the ANSWER TO THE QUESTION OF
LIFE, THE UNIVERSE, AND EVERYTHING IS....


yes, yes...


You're really not going to like this...


JUST TELL US!


The answer is....
FOUR-TY TWO


What?
That's it?

Yes, I checked it twice. It was a tough one, too!

But that doesn't make any sense at all.
Yes, I mean "42" -- what does that mean?

Exactly!

What?

That's the answer. But, what is the question?

Well, of course it's THE great question...

Yes?

You know. of, of, life, the Universe ... Everything.

Yes, but what does that mean?

What?

What does the question mean?

Well, it's, it's just the great question....


Exactly!

In order to understand the answer, you have to
know what the question itself IS.


Can you give us the question?

NO!

Oh, bugger.

But, I can tell you who can...

Yes, yes.

I will give you the specifications of
the greatest computer in the entire history
of time and space. A computer so vast that
I am not worthy to utter the specifications
for it.

A computer the size of a planet.

A computer so complex,
that life itself shall form part of
its computational matrix.

And I shall name it for you.

The computer shall

be

called

THE EARTH...

So, begins the last 10 million years
of our world's existence.....

-- (adapted slightly from)

The Hitch-Hiker's Guide to the Galaxy.
By Douglas Adams

available at bookstores, libraries and
space stations everywhere.

Look for the big, friendly green-creature
on the front cover and the nicely re-assuring
words:

Don't Panic!

-- Don't leave your planet without it!!!

--
Garrett Goebel
IS Development Specialist

ScriptPro Direct: 913.403.5261
5828 Reeds Road Main: 913.384.1008
Mission, KS 66202 Fax: 913.384.2180
www.scriptpro.com garrett at scriptpro dot com

Christian Renz

unread,
Aug 7, 2003, 3:14:18 PM8/7/03
to Leopold Toetsch, Nicholas Clark, Jos Visser, Perl6 Internals (parrot)
>Shouldn't it be the
>what_do_you_get_if_you_multiply_six_by_nine_then_subtract_twelve op?

No, it shouldn't. Meditate about it again and you will be enlightened.

Hint: "Base 13".

Greetings,
Christian

--
cr...@web42.com - http://www.web42.com/crenz/ - http://www.web42.com/

"The worst attitude of all would be the professional attitude which regards
children in the lump as a sort of raw material which we have to handle."
-- C.S. Lewis, On Three Ways of Writing for Children

David H. Adler

unread,
Aug 8, 2003, 2:20:46 AM8/8/03
to Perl6 Internals (parrot)
On Thu, Aug 07, 2003 at 12:57:11PM -0400, Gordon Henriksen wrote:
> This is really a language feature; you should add it to the hq9+
> implementation.

Sadly, this was not considered when hq9+ was developed, so it's not
actually part of the language. Maybe someone should develop and
extended version - hq9+42

dha
--
David H. Adler - <d...@panix.com> - http://www.panix.com/~dha/
however, if people don't like Perl, they don't have to use it. they
can stay at the office solving their problems while the Perl Mongers
go out and drink. ;) - brian d foy in c.l.p.misc

Nicholas Clark

unread,
Aug 8, 2003, 7:33:03 AM8/8/03
to David H. Adler, Perl6 Internals (parrot)
On Fri, Aug 08, 2003 at 02:20:46AM -0400, David H. Adler wrote:
> On Thu, Aug 07, 2003 at 12:57:11PM -0400, Gordon Henriksen wrote:
> > This is really a language feature; you should add it to the hq9+
> > implementation.
>
> Sadly, this was not considered when hq9+ was developed, so it's not
> actually part of the language. Maybe someone should develop and
> extended version - hq9+42

No, hq9*6, surely?

(if everyone is still in the dark about six by nine see
http://whatis.techtarget.com/definition/0,,sid9_gci211501,00.html
)

Which reminds me, we don't have an implementation of Beatnik yet, do we?

Nicholas Clark

David H. Adler

unread,
Aug 8, 2003, 1:51:17 PM8/8/03
to Perl6 Internals (parrot)
On Fri, Aug 08, 2003 at 12:33:03PM +0100, Nicholas Clark wrote:
> On Fri, Aug 08, 2003 at 02:20:46AM -0400, David H. Adler wrote:
> > On Thu, Aug 07, 2003 at 12:57:11PM -0400, Gordon Henriksen wrote:
> > > This is really a language feature; you should add it to the hq9+
> > > implementation.
> >
> > Sadly, this was not considered when hq9+ was developed, so it's not
> > actually part of the language. Maybe someone should develop and
> > extended version - hq9+42
>
> No, hq9*6, surely?

Well, that loses the all-important increment op. How about hq9+(6*9) ?

> (if everyone is still in the dark about six by nine see
> http://whatis.techtarget.com/definition/0,,sid9_gci211501,00.html
> )

Frankly, I always thought that Arthur's explanation was more convincing
than the base 13 argument...

dha
--
David H. Adler - <d...@panix.com> - http://www.panix.com/~dha/

"We are the Borg. You will be assimilated! Nah, only kidding. We're
just the Sontarans. Care to take part in some 'medical research'?"

Gordon Henriksen

unread,
Aug 8, 2003, 3:15:03 PM8/8/03
to Perl6 Internals (parrot), David H. Adler
On Fri, Aug 08, 2003 at 01:51PM -0400, David H. Adler wrote:
> On Fri, Aug 08, 2003 at 12:33:03PM +0100, Nicholas Clark wrote:
> > On Fri, Aug 08, 2003 at 02:20:46AM -0400, David H. Adler wrote:
> > > On Thu, Aug 07, 2003 at 12:57:11PM -0400, Gordon Henriksen wrote:
> > > > This is really a language feature; you should add it to the hq9+
> > > > implementation.
> > >
> > > Sadly, this was not considered when hq9+ was developed,
> > > so it's not actually part of the language. Maybe someone should
> > > develop and extended version - hq9+42
> >
> > No, hq9*6, surely?
>
> Well, that loses the all-important increment op. How about
> hq9+(6*9) ?

Maybe just h9q+a...?

0 new messages