[perl #130685] operators as macros sink their arguments

2017-01-31 Thread via RT
# New Ticket Created by Benjamin Goldberg # Please include the string: [perl #130685] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=130685 > When I type the following in the #perl6 irc channel: m: use experimental :mac

[perl #125615] [LTA] error message when trying to use NYI textual macros

2016-04-26 Thread Will Coleda via RT
can implement > it... No real change, though now you have to declare it experimental. 16:23 < [Coke]> m: use experimental :macros; macro FOO { 'say 1' }; FOO; 16:23 < camelia> rakudo-moar ce5dc0: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤» -- Will "Coke" Coleda

[perl #125615] LTA error message when trying to use NYI textual macros

2015-07-14 Thread via RT
# New Ticket Created by Alex Jakimenko # Please include the string: [perl #125615] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125615 > Code: macro FOO { 'say 1' }; FOO; Result: ===SORRY!=== Too few positionals passed; exp

[perl #124966] Roast rakudo skip/todo test:./S06-macros/unquoting.t line:66 reason: ?

2015-05-09 Thread Christian Bartolomaeus via RT
This test is actually passing. I unfudged the test with commit https://github.com/perl6/roast/commit/e4252cd33a

[perl #124969] Roast rakudo skip/todo test:./S06-macros/quasi-blocks.t line:115 reason: ?

2015-05-09 Thread Christian Bartolomaeus via RT
This test is actually passing. I unfudged the test with commit https://github.com/perl6/roast/commit/dc34eeacfd

[perl #125099] Macros that return a string can't be invoked

2015-05-04 Thread via RT
# New Ticket Created by Rob Hoelz # Please include the string: [perl #125099] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=125099 > Following this example: macro f() { '1 + 1' } say f(); from http://des

[perl6/specs] 272d12: clarify that macros can't be called before they're...

2014-12-12 Thread GitHub
-routines.pod Log Message: --- clarify that macros can't be called before they're defined

[perl #120928] [BUG] Macros bind to the static lexpad, surprising users, in Rakudo

2014-01-04 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #120928] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=120928 > p: my %h; macro attr($key, $val) { quasi { %h{ {{{$key}}} } = {{{$val}}} } }; attr("x",

[perl #118827] [BUG] macros die on using sigilless paramers in Rakudo

2013-07-09 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #118827] # in the subject line of all future correspondence about this issue. # https://rt.perl.org:443/rt3/Ticket/Display.html?id=118827 > masak: dies in the compiler: r: say "alive"; macro assign(\a) { sub ($b is rw)

[perl #115604] [BUG] our macros don't work in Rakudo

2012-11-05 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #115604] # in the subject line of all future correspondence about this issue. # https://rt.perl.org:443/rt3/Ticket/Display.html?id=115604 > r: our macro foo() { }; foo() rakudo 64208d: OUTPUT«===SORRY!===␤Error while co

Re: S06 -- grammatical categories and macros

2010-07-01 Thread Aaron Sherman
On Wed, Jun 30, 2010 at 7:33 PM, Jonathan Worthington wrote: > Aaron Sherman wrote: > >> See below for the S06 section I'm referring to. >> >> I'm wondering how we should be reading the description of user-defined >> operators. For example, "sub infix:<(c)>" doesn't describe >> the precedence leve

Re: S06 -- grammatical categories and macros

2010-06-30 Thread Jonathan Worthington
Aaron Sherman wrote: See below for the S06 section I'm referring to. I'm wondering how we should be reading the description of user-defined operators. For example, "sub infix:<(c)>" doesn't describe the precedence level of this new op, so how is it parsed? Is there a default? The default is

S06 -- grammatical categories and macros

2010-06-30 Thread Aaron Sherman
file 'EVAL_1' line 105914178 Eh? What newline? And line 105914178? OK, so that's a bug, but the question is, should I expect it to work? Things get a bit more strange when I try to wrap my head around macros. From the example: macro circumfix:«» ($text) is parsed / .*? /

Re: [perl #39855] [CAGE] configuration: define MIN/MAX macros for all integral typedefs

2009-04-23 Thread NotFound
> It looks like those comments in platform_limits.h are out-of-place. > PARROT_INTVAL_MIN and PARROT_INTVAL_MAX are defined in > include/parrot/config.h, although the definition may not be as flexible > as the macros in perl.h that Nicholas mentioned.  It might be beneficial > to i

Re: [perl #39855] [CAGE] configuration: define MIN/MAX macros for all integral typedefs

2009-04-18 Thread NotFound
>> It's great to have INTVAL and UINTVAL, but without MAX_INTVAL it's kind of >> hard to work with them in some respects.  All integral typedefs should > have >> min/max macros.  Syntax not a big deal, it can be fixed later, just don't >> break anyth

Re: [perl #39855] [CAGE] configuration: define MIN/MAX macros for all integral typedefs

2009-04-18 Thread Nicholas Clark
INTVAL, but without MAX_INTVAL it's > > kind of > > > > hard to work with them in some respects. All integral typedefs should > > > have > > > > min/max macros. Syntax not a big deal, it can be fixed later, just > > don't > > > > break an

[perl #44393] [PATCH] something funny in dod/gc blocking macros

2008-07-02 Thread Christoph Otto via RT
On Tue May 06 17:41:43 2008, coke wrote: > On Fri Aug 03 13:43:42 2007, [EMAIL PROTECTED] wrote: > > On Friday 03 August 2007 13:29:53 Jerry Gay wrote: > > > > > i'm having trouble on x86_64. when running a 32bit parrot, i get > > > occasional deadlock at the OS level, after Parrot_exit. when runn

[perl #39855] [CAGE] configuration: define MIN/MAX macros for all integral typedefs

2008-05-17 Thread Patrick R. Michaud via RT
On Mon Jul 17 11:59:47 2006, chip wrote: > It's great to have INTVAL and UINTVAL, but without MAX_INTVAL it's kind of > hard to work with them in some respects. All integral typedefs should have > min/max macros. Syntax not a big deal, it can be fixed later, just don'

[perl #44393] something funny in dod/gc blocking macros

2008-05-06 Thread Will Coleda via RT
On Fri Aug 03 13:43:42 2007, [EMAIL PROTECTED] wrote: > On Friday 03 August 2007 13:29:53 Jerry Gay wrote: > > > i'm having trouble on x86_64. when running a 32bit parrot, i get > > occasional deadlock at the OS level, after Parrot_exit. when running a > > 64bit parrot, it segfaults within Parrot_

[perl #41633] [CAGE] convert handrolled .IMPORT macros with library function

2008-02-04 Thread Will Coleda via RT
On Sat Mar 03 09:35:05 2007, particle wrote: > On 3/3/07, Elizabeth Mattijsen via RT [EMAIL PROTECTED]> wrote: > > On Tue Feb 27 12:58:18 2007, particle wrote: > > > it seems over time there have been a few handrolled > implementations of > > > namespace impo

[perl #46697] [TODO] [C] Move the exception macros from src/pmc/coroutine.pmc into exceptions.h

2007-11-11 Thread Paul Cochrane via RT
lease include the string: [perl #46697] > ># in the subject line of all future correspondence about this issue. > ># http://rt.perl.org/rt3/Ticket/Display.html?id=46697 > > > > >In src/pmc/coroutine.pmc there is the todo item: > > > >/* XXX put t

[perl #46697] [TODO] [C] Move the exception macros from src/pmc/coroutine.pmc into exceptions.h

2007-10-22 Thread Bob Rogers
Ticket/Display.html?id=46697 > In src/pmc/coroutine.pmc there is the todo item: /* XXX put these into exceptions.h */ After this comment there are four macros. These need to be transferred to exceptions.h and then the header used in this file. These macros are not used, so I nuked 

Re: [PIR] Macros: features?

2007-10-22 Thread Allison Randal
plementation. Currently constants are declared as .const in PIR and .constant in PASM. These two should be merged into one. I don't have a strong preference but lean toward keeping .constant and deprecating .const (the full word is generally more readable). * comments. Lots of it. * beginni

Re: [PIR] Macros: features?

2007-10-22 Thread Klaas-Jan Stol
e .include directive > > +3 > > > * .constant directive works, but I found out IMCC only allows it in PASM > > mode. If this is desired behaviour, I have to change my implementation. > > Currently constants are declared as .const in PIR and .constant in PASM. > These tw

[perl #46697] [TODO] [C] Move the exception macros from src/pmc/coroutine.pmc into exceptions.h

2007-10-22 Thread via RT
s.h */ After this comment there are four macros. These need to be transferred to exceptions.h and then the header used in this file.

[PIR] Macros: features?

2007-10-20 Thread Klaas-Jan Stol
iple heredocs, allowing to write: .sub foo(<<'A', <<'B', <<'C') hi A hi there B hi again C * A clean implementation of the .include directive * .constant directive works, but I found out IMCC only allows it in PASM mode. If this is desired beh

Re: [perl #44393] something funny in dod/gc blocking macros

2007-08-03 Thread chromatic
On Friday 03 August 2007 13:29:53 Jerry Gay wrote: > i'm having trouble on x86_64. when running a 32bit parrot, i get > occasional deadlock at the OS level, after Parrot_exit. when running a > 64bit parrot, it segfaults within Parrot_exit, while running the exit > handlers. if i run with -G, no se

[perl #44393] something funny in dod/gc blocking macros

2007-08-03 Thread Jerry Gay via RT
hi, i'm a blockhead. ron reminded me that i'm not following C89, since node was not defined at the top of a block. duh. anyway, this doesn't seem to fix the problem. rats. i must misunderstand the comment, because i find it hard to believe that adding these few lines of code is enough to address a

[perl #44393] something funny in dod/gc blocking macros

2007-08-03 Thread via RT
ruct/union src\exit.c(81) : warning C4022: 'mem_sys_free' : pointer mismatch for actual par ameter 1 src\exit.c(82) : warning C4047: '=' : 'int' differs in levels of indirection fro m 'handler_node_t *const ' === huh? something must be funny in these ma

Re: Documenting the PARROT_XXX macros

2007-07-15 Thread Mark Glines
On Sun, 15 Jul 2007 23:48:54 -0500 Andy Lester <[EMAIL PROTECTED]> wrote: > I want to document all the PARROT_XXX macros that I've been creating > and applying, but I'm not sure where they'd be best. I don't think > pdd07_codingstd.pod is right, because it

Re: Documenting the PARROT_XXX macros

2007-07-15 Thread chromatic
On Sunday 15 July 2007 21:48:54 Andy Lester wrote: > I want to document all the PARROT_XXX macros that I've been creating > and applying, but I'm not sure where they'd be best. I don't think > pdd07_codingstd.pod is right, because it's not coding standard

Documenting the PARROT_XXX macros

2007-07-15 Thread Andy Lester
I want to document all the PARROT_XXX macros that I've been creating and applying, but I'm not sure where they'd be best. I don't think pdd07_codingstd.pod is right, because it's not coding standards exactly. I want to talk about defensive programming, and why the

Macros that assume variables are awful

2007-06-29 Thread Andy Lester
The PANIC() macro used to look like this #define PANIC(message) do_panic(interp, message, __FILE__, __LINE__) Note how it assumes that we have an "interp" in scope. But what do we do in src/gc/malloc.c? When we don't have an interp and want to pass NULL to do_panic? Of course! We #de

Re: [perl #41633] [CAGE] convert handrolled .IMPORT macros with library function

2007-03-03 Thread jerry gay
On 3/3/07, Elizabeth Mattijsen via RT <[EMAIL PROTECTED]> wrote: On Tue Feb 27 12:58:18 2007, particle wrote: > it seems over time there have been a few handrolled implementations of > namespace import macros. they are usually named something like > '.IMPORT' and live in

[perl #41633] [CAGE] convert handrolled .IMPORT macros with library function

2007-02-27 Thread via RT
ort macros. they are usually named something like '.IMPORT' and live in various pir source, test and example files. i've added an import sub to F now, which can be used in place of these various implementations. ~jerry

[PATCH] lang/PIR macros!

2007-02-16 Thread Klaas-Jan Stol
bj +# printerr "\n" +# goto loop +#endloop: +# printerr "\n===\n" +# .return (mob, adverbs :flat :named) .end +# +# Clear all heredoc labels +# +.sub clear_heredocs + .local pmc labels + .local int count, i + labels = get_root_global 'heredoc' + co

Re: multi-line comments, C macros, & Pod abuse

2006-08-21 Thread markjreed
ng. Which got me thinking about more sophisticated compile time flow control. I imagine that defining something like a compile time switch switch statement is possible with the existing macros. Would anyone like to take a shot at defining a macro to do this? Is it possible to jump to something o

Re: multi-line comments, C macros, & Pod abuse

2006-08-21 Thread Joshua Hoblitt
more sophisticated compile time flow control. I imagine that defining something like a compile time switch switch statement is possible with the existing macros. Would anyone like to take a shot at defining a macro to do this? Is it possible to jump to something outside of a macros input that is al

Re: multi-line comments, C macros, & Pod abuse

2006-08-20 Thread Andrew Suffield
On Sun, Aug 20, 2006 at 03:55:56PM -0600, Luke Palmer wrote: > >The important question here is this one: > > > > - when 'uncommented', is it a no-op? > > > >Which isn't true for #{}/{}, because {} introduces new lexical > >scope. > Why would you care about introducing a new lexical scope? You wou

Re: multi-line comments, C macros, & Pod abuse

2006-08-20 Thread Luke Palmer
On 8/20/06, Luke Palmer <[EMAIL PROTECTED]> wrote: Well, I think you are being too picky. [snip snarky sarcastic rant] Hmm, perhaps I'm feeling edgy. Or maybe some of the comments reminded me of those rediculously long, whiny threads. Anyway, that was un-called-for. Luke

Re: multi-line comments, C macros, & Pod abuse

2006-08-20 Thread Luke Palmer
On 8/20/06, Andrew Suffield <[EMAIL PROTECTED]> wrote: On Sun, Aug 20, 2006 at 10:50:31AM -1000, Joshua Hoblitt wrote: > > #{ > >if $baz { > >$foo.bar > >} > > } > > > > To uncomment, remove the # before the {. > > This is exactly the type of construct that I had in mind. A coupl

Re: multi-line comments, C macros, & Pod abuse

2006-08-20 Thread Larry Wall
On Sun, Aug 20, 2006 at 10:50:31AM -1000, Joshua Hoblitt wrote: : On Sat, Aug 19, 2006 at 02:26:28AM +, Luke Palmer wrote: : > On 8/19/06, Aaron Crane <[EMAIL PROTECTED]> wrote: : > >You don't actually need a macro in that case: : > > : > >if 0 { q< : > >... : > >> } : > : > Wh

Re: multi-line comments, C macros, & Pod abuse

2006-08-20 Thread Andrew Suffield
On Sun, Aug 20, 2006 at 10:50:31AM -1000, Joshua Hoblitt wrote: > > #{ > >if $baz { > >$foo.bar > >} > > } > > > > To uncomment, remove the # before the {. > > This is exactly the type of construct that I had in mind. A couple of > questions. Is code inside of a #{}: > > - p

Re: multi-line comments, C macros, & Pod abuse

2006-08-20 Thread Mark J. Reed
On 8/20/06, Joshua Hoblitt <[EMAIL PROTECTED]> wrote: This is exactly the type of construct that I had in mind. A couple of questions. Is code inside of a #{}: - parsed and required to be syntacticly correct? No. It's a comment. # followed by one or more open bracket characters creates a

Re: multi-line comments, C macros, & Pod abuse

2006-08-20 Thread Joshua Hoblitt
On Sat, Aug 19, 2006 at 02:26:28AM +, Luke Palmer wrote: > On 8/19/06, Aaron Crane <[EMAIL PROTECTED]> wrote: > >You don't actually need a macro in that case: > > > >if 0 { q< > >... > >> } > > Which, of course, eliminates the original desire to have a > code-commenting constru

Re: multi-line comments, C macros, & Pod abuse

2006-08-19 Thread Daniel Hulme
> "Stuart Cook" schreef: > > Larry Wall: > > >> if 0 { > >> ... > >> } > > > > The one disadvantage of that approach is that it will break if the > > "commented-out" code temporarily fails to compile. > > How frequent does that happen? All the time. I often comment out bits of code wh

Re: multi-line comments, C macros, & Pod abuse

2006-08-19 Thread Dr.Ruud
"Stuart Cook" schreef: > Larry Wall: >> if 0 { >> ... >> } > > The one disadvantage of that approach is that it will break if the > "commented-out" code temporarily fails to compile. How frequent does that happen? And in that case s/if 0/\#/, as Luke mentioned. And if the compile fai

Re: multi-line comments, C macros, & Pod abuse

2006-08-19 Thread Nicholas Clark
On Sat, Aug 19, 2006 at 02:26:28AM +, Luke Palmer wrote: > On 8/19/06, Aaron Crane <[EMAIL PROTECTED]> wrote: > >You don't actually need a macro in that case: > > > >if 0 { q< > >... > >> } > > Which, of course, eliminates the original desire to have a > code-commenting constru

Re: multi-line comments, C macros, & Pod abuse

2006-08-18 Thread Luke Palmer
On 8/19/06, Aaron Crane <[EMAIL PROTECTED]> wrote: You don't actually need a macro in that case: if 0 { q< ... > } Which, of course, eliminates the original desire to have a code-commenting construct where "you just change the 0 to a 1". After all, we already have #{}. Incide

Re: multi-line comments, C macros, & Pod abuse

2006-08-18 Thread Aaron Crane
Stuart Cook writes: > On 8/19/06, Larry Wall <[EMAIL PROTECTED]> wrote: > >if 0 { > >... > >} > > The one disadvantage of that approach is that it will break if the > "commented-out" code temporarily fails to compile. If that's a > problem, though, you could always write your own macr

Re: multi-line comments, C macros, & Pod abuse

2006-08-18 Thread Stuart Cook
On 8/19/06, Larry Wall <[EMAIL PROTECTED]> wrote: if 0 { ... } The one disadvantage of that approach is that it will break if the "commented-out" code temporarily fails to compile. If that's a problem, though, you could always write your own macro. Stuart Cook

Re: multi-line comments, C macros, & Pod abuse

2006-08-18 Thread Larry Wall
On Fri, Aug 18, 2006 at 11:58:20AM -1000, Joshua Hoblitt wrote: : It occurred to me that other day that in our "in house" C code we : somewhat frequently use an idiom that's not easily translated into Perl : 5. Our rule is that if your commenting out more then 1 or 2 lines of : code that you wrap

multi-line comments, C macros, & Pod abuse

2006-08-18 Thread Joshua Hoblitt
It occurred to me that other day that in our "in house" C code we somewhat frequently use an idiom that's not easily translated into Perl 5. Our rule is that if your commenting out more then 1 or 2 lines of code that you wrap it in a CPP if statement. The logic being that if you haven't deleted t

[perl #39855] configuration: define MIN/MAX macros for all integral typedefs

2006-07-17 Thread via RT
nd of hard to work with them in some respects. All integral typedefs should have min/max macros. Syntax not a big deal, it can be fixed later, just don't break anything when introducing them. -- Chip Salzenberg <[EMAIL PROTECTED]>

Re: Macros?

2006-02-06 Thread Larry Wall
Wall wrote: : >Macros are functions or operators that are called by the compiler as : >soon as their arguments are parsed (if not sooner). The syntactic : >effect of a macro declaration or importation is always lexically : >scoped, even if the name of the macro is visible elsewhere.

Re: Macros?

2006-02-04 Thread Brad Bowman
Hi, I've read and reread the macro explanation but I'm still not entirely clear on number of things. The questions and thoughts below are based on my (mis)understanding. On 03/02/06 02:05, Larry Wall wrote: Macros are functions or operators that are called by the compiler as

Re: Macros?

2006-02-02 Thread Larry Wall
After a little more cleanup, S06 now reads: =head2 Macros Macros are functions or operators that are called by the compiler as soon as their arguments are parsed (if not sooner). The syntactic effect of a macro declaration or importation is always lexically scoped, even if

Re: Macros?

2006-02-02 Thread Larry Wall
e would also like a quasiquoting mechanism, so don't have to rely on : string concatenation, and we don't have to construct parse trees by : hand. It's sort of a happy medium. But that is as yet unspecced. S06 now sez: +=head2 Macros +Macros are functions or operators that are call

Re: Macros?

2006-01-29 Thread Yuval Kogman
On Sun, Jan 29, 2006 at 20:29:43 +, Herbert Snorrason wrote: > On 29/01/06, Yuval Kogman <[EMAIL PROTECTED]> wrote: > > Basically the plan is that when an internal AST language is decided > > upon, the macros will be able to get either the source code text, or > >

Re: Macros?

2006-01-29 Thread Herbert Snorrason
On 29/01/06, Yuval Kogman <[EMAIL PROTECTED]> wrote: > Basically the plan is that when an internal AST language is decided > upon, the macros will be able to get either the source code text, or > an AST. Two things. First, if the AST path is taken, doesn't that mean that the AS

Re: Macros?

2006-01-29 Thread Luke Palmer
On 1/29/06, Yuval Kogman <[EMAIL PROTECTED]> wrote: > Aside from that they are normal perl 6 subroutines, that simply get > invoked during compile time instead of during runtime. With one extra "feature". By default (my preference) or with a trait, parameters can get passed in as ASTs instead of

Re: Macros?

2006-01-29 Thread Yuval Kogman
On Sun, Jan 29, 2006 at 18:53:25 +, Herbert Snorrason wrote: > Perl6 will have macros. Good. Cool. But, sadly, that seems to be close > to the most specific thing anyone says about the subject. There is > some further discussion in Apocalypse & Exegesis 6, but nothing in t

Macros?

2006-01-29 Thread Herbert Snorrason
Perl6 will have macros. Good. Cool. But, sadly, that seems to be close to the most specific thing anyone says about the subject. There is some further discussion in Apocalypse & Exegesis 6, but nothing in the Synopsis. Now, considering that macros are a language feature and that the Synopses

imcc, macros, and tcl

2005-12-17 Thread Leopold Toetsch
We were struggling with some memory corruption seen mainly in tcl [1] since quite a time. I think, I've found it now, thanks to an example Matt has pasted this morning. The reason is: - there is a hard limit of 256 macros - this was marked with XXX but *not checked* - each .include

Re: Bug or feature? Probably bug with macros

2005-12-12 Thread Larry Wall
On Mon, Dec 12, 2005 at 11:14:32AM -0800, Chip Salzenberg wrote: : I still think heredocs were a botch for : Perl, which is generally not line-oriented. Hmm, well, the point is not so much whether Perl is line-oriented, but whether the *data* is line-oriented. The orientation of Perl is to go the

Re: Bug or feature? Probably bug with macros

2005-12-12 Thread Joshua Isom
remove conditionals around existing code. Forbidding commas as macros are defined is to be expected. The biggest issue with commas that I've seen is that inside a comment, the commas are not commented out in regards to parsing the macro. Escaped commas wouldn't necessarily be a h

Re: Bug or feature? Probably bug with macros

2005-12-12 Thread Roger Browne
On Mon, 2005-12-12 at 10:55 -0800, Chip Salzenberg wrote: > Forbidding commas in the expanded code is not OK So why not treat the comma as a delimiter only when either (1) It is on the same line as the start of the macro call, or (2) it appears alone on a line. The same rule can apply for the c

Re: Bug or feature? Probably bug with macros

2005-12-12 Thread Chip Salzenberg
On Mon, Dec 12, 2005 at 02:07:41PM -0500, Will Coleda wrote: > On Dec 12, 2005, at 1:55 PM, Chip Salzenberg wrote: > >So I guess we just need a robust multi-line quoting convention (to > >pass multiple lines of code to macros). > > That sounds suspiciously like a HE

Re: Bug or feature? Probably bug with macros

2005-12-12 Thread Will Coleda
So I guess we just need a robust multi-line quoting convention (to pass multiple lines of code to macros). That sounds suspiciously like a HEREDOC. See: http://rt.perl.org/rt3/Ticket/Display.html?id=37600, which was marked as rejected. (Musing while typing:) How about using braces as bal

Re: Bug or feature? Probably bug with macros

2005-12-12 Thread Chip Salzenberg
I guess we just need a robust multi-line quoting convention (to pass multiple lines of code to macros). (Musing while typing:) How about using braces as balanced delimeters when an open brace is the first character: .IfDebug(1, { multi,line stuff,with,comma

Re: Bug or feature? Probably bug with macros

2005-12-11 Thread Leopold Toetsch
On Dec 11, 2005, at 23:45, Joshua Isom wrote: It could be very beneficial for debugging. My debugger tends to be a lot of print statements, so something like .globalconst int DEBUG = 1 .macro IfDebug(level, code) unless .level >= DEBUG goto .$endif .code .local $endif

Re: Bug or feature? Probably bug with macros

2005-12-11 Thread Joshua Isom
M, Leopold Toetsch wrote: On Dec 11, 2005, at 0:53, Joshua Isom wrote: Since it's not documented at all that I've seen, either for or against, I'm wondering what's the arguments to macros are supposed to be. Consider this code. .sub main :main .IfElse(TRUE,

Re: Bug or feature? Probably bug with macros

2005-12-11 Thread Leopold Toetsch
On Dec 11, 2005, at 0:53, Joshua Isom wrote: Since it's not documented at all that I've seen, either for or against, I'm wondering what's the arguments to macros are supposed to be. Consider this code. .sub main :main .IfElse(TRUE, print "True\n"

Bug or feature? Probably bug with macros

2005-12-10 Thread Joshua Isom
Since it's not documented at all that I've seen, either for or against, I'm wondering what's the arguments to macros are supposed to be. Consider this code. -- .const int TRUE = 1 .const int FALSE = 0 .macro IfElse(conditional, foo, bar) unless .con

Re: Anonymous macros?

2005-06-13 Thread Larry Wall
On Mon, Jun 13, 2005 at 05:25:59PM +0200, Ingo Blechschmidt wrote: : just checking: Are anonymous macros allowed? I have no problem with macros being first-class objects during the compile. Though the macro itself may have a problem with your passing it '3' when it is likely expect

Anonymous macros?

2005-06-13 Thread Ingo Blechschmidt
Hi, just checking: Are anonymous macros allowed? my $macro = macro ($x) { "100$x" }; say $macro(3); # 1003 Of course, anonymous macros can't be called at compile-time, like normal macros: my $macro = rand < 0.5 ?? macro ($x) { "100$x" } :: macro ($x)

Re: [svn:parrot] rev 7886 - in trunk: . config/gen/makefiles dynclasses languages/tcl/lib/commands languages/tcl/lib/macros

2005-04-20 Thread Leopold Toetsch
William Coleda <[EMAIL PROTECTED]> wrote: > Ah. That would explain why I had to back in and delete the file that I > had already deleted - because I deleted the wrong file! Ok. But: > Leopold Toetsch wrote: >> $ perl tools/dev/manicheck.pl >> >> doesn't complain at all. leo

Re: [svn:parrot] rev 7886 - in trunk: . config/gen/makefiles dynclasses languages/tcl/lib/commands languages/tcl/lib/macros

2005-04-20 Thread William Coleda
Ah. That would explain why I had to back in and delete the file that I had already deleted - because I deleted the wrong file! Fixed. Leopold Toetsch wrote: [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: --- trunk/MANIFEST (original) +++ trunk/MANIFEST Tue Apr 19 16:51:10 2005 @@ -50,7 +5

Re: [svn:parrot] rev 7886 - in trunk: . config/gen/makefiles dynclasses languages/tcl/lib/commands languages/tcl/lib/macros

2005-04-19 Thread Leopold Toetsch
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > --- trunk/MANIFEST(original) > +++ trunk/MANIFESTTue Apr 19 16:51:10 2005 >@@ -50,7 +50,6 @@ > -classes/boolean.pmc [] I don't understand this change to MANIFEST. classes/boolean.pmc is for sure used, but $ p

Re: Macros [was: Whither "use English"?]

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 12:45:14PM +1200, Sam Vilain wrote: : Larry Wall wrote: : > Well, only if you stick to a standard dialect. As soon as you start : > defining your own macros, it gets a little trickier. : : Interesting, I hadn't considered that. : : Having a quick browse thro

Macros [was: Whither "use English"?]

2005-04-14 Thread Sam Vilain
Larry Wall wrote: (B> Well, only if you stick to a standard dialect. As soon as you start (B> defining your own macros, it gets a little trickier. (B (BInteresting, I hadn't considered that. (B (BHaving a quick browse through some of the discussions about macros, many (Bof the m

Re: COND macros

2004-11-22 Thread Leopold Toetsch
Gabe Schaffer <[EMAIL PROTECTED]> wrote: > That's no problem except where a given COND can be either signalled or > broadcast to. Such issues need good comments in source code. Does that imply that we need: COND_INIT_SIGNAL COND_INIT_BROADCAST > GNS leo

Re: COND macros

2004-11-21 Thread Gabe Schaffer
On Sun, 21 Nov 2004 10:09:06 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Gabe Schaffer <[EMAIL PROTECTED]> wrote: > Currently we have COND only for the task queues. But if we need > conditions in other places, QUEUE_CONDITION is misleading. > So the current se

Re: COND macros

2004-11-21 Thread Leopold Toetsch
have COND only for the task queues. But if we need conditions in other places, QUEUE_CONDITION is misleading. So the current set of macros for existing stuff is ok? > Also, note that with Win32 conditions you must indicate at creation > time whether you want to Signal or Broadcast. Emulat

Re: COND macros

2004-11-19 Thread Leopold Toetsch
eeded for windows. OTOH a mutex aka critical section is needed separatly. So we should probably define these macros to be: COND_INIT(c, m) COND_DESTROY(c, m) see src/tsq.c for usage. Does win32 require more info to create conditions/mutexes or would these macros suffice? Win32 doesn't requir

Re: COND macros (was: Threads, events, Win32, etc.)

2004-11-19 Thread Dan Sugalski
second step, which isn't needed for windows. OTOH a mutex aka critical section is needed separatly. So we should probably define these macros to be: COND_INIT(c, m) COND_DESTROY(c, m) see src/tsq.c for usage. Does win32 require more info to create conditions/mutexes or would these macr

Re: COND macros (was: Threads, events, Win32, etc.)

2004-11-19 Thread Gabe Schaffer
ded for windows. OTOH a mutex aka critical section is needed > separatly. > > So we should probably define these macros to be: > > COND_INIT(c, m) > COND_DESTROY(c, m) > > see src/tsq.c for usage. > > Does win32 require more info to create conditions/mutexes or wo

COND macros (was: Threads, events, Win32, etc.)

2004-11-17 Thread Leopold Toetsch
COND_INIT macro just passes a condition location, the mutex is created in a second step, which isn't needed for windows. OTOH a mutex aka critical section is needed separatly. So we should probably define these macros to be: COND_INIT(c, m) COND_DESTROY(c, m) see src/tsq.c for usage. Doe

Re: cvs commit: parrot/languages/tcl/lib/macros boolean.imc

2004-10-15 Thread Leopold Toetsch
William Coleda <[EMAIL PROTECTED]> wrote: > Though I have to wonder how this will work with inter-language-operability. bool = istrue(some_pmc) is exactly that. Your PMC can answer 1 if it's "true" or such. A lispish PMC might evaluate "t" and "nil"... > Thanks, Leo. Welcome, leo

Re: cvs commit: parrot/languages/tcl/lib/macros boolean.imc

2004-10-15 Thread William Coleda
Danke. Making this a macro was, at least, a step up from the function call I had. I haven't done anything real with the PMCs yet (just cargo-culted them mostly from their Perl* counterparts) Though I have to wonder how this will work with inter-language-operability. Thanks, Leo. Leopold Toetsch wr

Re: cvs commit: parrot/languages/tcl/lib/macros boolean.imc

2004-10-15 Thread Leopold Toetsch
Will Coleda <[EMAIL PROTECTED]> wrote: > > Given a pmc, set a register to indicate whether > it is true or false from Tcl's POV. inline op istrue(out INT, in PMC) { with an approprate get_bool() vtable slot. leo

Re: macros, local variables...

2004-10-10 Thread William Coleda
Leopold Toetsch wrote: .macro swapP (A,B) $P0 = .A .A = .B .B = $P0 .endm (untested) Seems to work, thanks. *But* we have an opcode called *exchange* ... It's even JITted on i386. This was just an example. Thanks. leo

Re: macros, local variables...

2004-10-08 Thread Leopold Toetsch
specifying the TEMP parameter? For example, something like: .macro swap (A,B) .local pmc .TEMP .local inside macros creates a local *label*. As the macro arguments could be any kind of register, the macro can't have the TEMP hidden inside. If you are gonna swap PMCs only, you could write

Re: macros, local variables...

2004-10-07 Thread Michael Walter
gensym, hehe. History repeats ;-) - Michael On Thu, 07 Oct 2004 21:49:22 -0400, William Coleda <[EMAIL PROTECTED]> wrote: > A macro example in the docs shows: > > .macro swap (A,B,TEMP) # . marks the directive > set .TEMP,.A # . marks the special variable. > set .A,.B > se

macros outside of subroutines

2004-10-07 Thread William Coleda
btw, thanks to whoever fixed macros so that they could be defined outside of .sub's. Very handy.

macros, local variables...

2004-10-07 Thread William Coleda
A macro example in the docs shows: .macro swap (A,B,TEMP) # . marks the directive set .TEMP,.A # . marks the special variable. set .A,.B set .B,.TEMP .endm # And . marks the end of the macro. Is there a way to write this macro without specifying the TEMP paramete

Re: [perl #25266] [PATCH] Unify PMC accessor macros

2004-01-26 Thread Leopold Toetsch
Gordon Henriksen (via RT) wrote: PMC accessor macros come in a bewildering variety of forms, depend upon one another, are scattered throughout pobj.h, are generally difficult to decipher. [ snip ] This patch defines yet another set of accessor macros, but these have a consistent naming

Re: [RFC] Parrot runtime include files and .constant macros

2004-01-09 Thread Melvin Smith
At 08:58 AM 1/9/2004 +0100, Leopold Toetsch wrote: Melvin Smith <[EMAIL PROTECTED]> wrote: > This also means .pasm files won't be able to .include these anymore, > you'd have to use IMC. Why not just make .const work in both modes? Because pure PASM doesn't currently use type names. .const expects

Re: [RFC] Parrot runtime include files and .constant macros

2004-01-09 Thread Leopold Toetsch
Melvin Smith <[EMAIL PROTECTED]> wrote: > This also means .pasm files won't be able to .include these anymore, > you'd have to use IMC. Why not just make .const work in both modes? > -Melvin leo

[RFC] Parrot runtime include files and .constant macros

2004-01-08 Thread Melvin Smith
Since all of the Parrot includes are .pasm and are using the old .constant directive, which was a macro expansion in the IMCC lexer, and I've removed macros from IMCC, I have a pending patch to parrot_include.pl and all of the parrot header files to change it to generate .imc include files r

  1   2   3   >