A few years of hobbyist cudding and I've yet to find much use for them outside making of generic special loops, of which every permutation of them have been implemented already by library contributors. LISPs aren't shit so boilerplate code doesn't happen, everything else can be made more tidy with lambdas. Has anyone used LISP's most marketable feature (hygienic or not) for anything at the app level?
1. It's fucking Gay
2. I have no use for gay ass lambda calculus
3. see #1
4. I have no use for monads
5. See #1
6. I don't find the fun in FUNctional programming
7. See #1
8. Did I say it's FUCKING QUEER LIKE A THREE DOLLAR BILL ALREADY!!!
Name:
Anonymous2011-10-23 14:15
>>4
Debugging macros is hard enough as it is. I'd rather write another page of C.
LISP macros are useless because its easier to write inline functions to do anything instead of pages of "magical macros".
Plus i can read the inline function and instantly construct the calling conventions/parameters for another level of nesting so there is enough complexity in page of nested functions to rival any LISP code and they don't need any GC or special syntax.
Name:
Anonymous2011-10-23 14:38
LISP macros are useless because its easier to write inline functions to do anything instead of pages of "magical macros".
I think you're talking out of your ass on this topic. Convince me otherwise.
Name:
FrozenVoid2011-10-23 15:08
>>10
In a syntactically crippled language they might be of use, but i prefer C text macros which are more intuitive and cover 99% of use cases of LISP macros(which can be answered by inline function as i noted in >>9).
>>9
Macros are not a replacement for inlining functions (you can declare a function to be inlined in CL), and it's bad form to use macros for that purpose. Their purpose is completly different.
Name:
Anonymous2011-10-23 15:17
The only macro I've used was a convenient way to make an anonymous function that can call itself.
>>14
I can show you a lot of things which you can't do using inline functions. Macros just generate code at compile-time: they can generate any kind of code dynamically, while an inline function is merely inserting the body of a function into another function. Lisp macros are not C macros either.
Yeah, one example of something you can get with macros that you can't get with inlined functions is dynamic scope, since the macro can directly manipulate local variables that happen to be defined in the function invoking the macro. I'm not saying this as a good thing to do in general though.
Another thing is that you have the option of deciding when to evaluate the arguments, or to evaluate them multiple times. You can also make your own parser in lisp and transform the arguments syntactically before evaluating them.
Name:
FrozenVoid2011-10-23 15:38
>>16
Nonsense all these can done with simple macros without even resorting to inline functions.
>manipulate local variables that happen to be defined in the function invoking the macro.
#define change(a) (a++)
>when to evaluate the arguments
#define changemacro(a,b) a?change(a):change(b)
>to evaluate them multiple times
#define change (...) //see http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
instance (Show a, Show b, Show c) => Show (a, b, c) where
showsPrec _ (a,b,c) s = show_tuple [shows a, shows b, shows c] s
instance (Show a, Show b, Show c, Show d) => Show (a, b, c, d) where
showsPrec _ (a,b,c,d) s = show_tuple [shows a, shows b, shows c, shows d] s
instance (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) where
showsPrec _ (a,b,c,d,e) s = show_tuple [shows a, shows b, shows c, shows d, shows e] s
instance (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a,b,c,d,e,f) where
showsPrec _ (a,b,c,d,e,f) s = show_tuple [shows a, shows b, shows c, shows d, shows e, shows f] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g)
=> Show (a,b,c,d,e,f,g) where
showsPrec _ (a,b,c,d,e,f,g) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h)
=> Show (a,b,c,d,e,f,g,h) where
showsPrec _ (a,b,c,d,e,f,g,h) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i)
=> Show (a,b,c,d,e,f,g,h,i) where
showsPrec _ (a,b,c,d,e,f,g,h,i) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h,
shows i] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j)
=> Show (a,b,c,d,e,f,g,h,i,j) where
showsPrec _ (a,b,c,d,e,f,g,h,i,j) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h,
shows i, shows j] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k)
=> Show (a,b,c,d,e,f,g,h,i,j,k) where
showsPrec _ (a,b,c,d,e,f,g,h,i,j,k) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h,
shows i, shows j, shows k] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k,
Show l)
=> Show (a,b,c,d,e,f,g,h,i,j,k,l) where
showsPrec _ (a,b,c,d,e,f,g,h,i,j,k,l) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h,
shows i, shows j, shows k, shows l] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k,
Show l, Show m)
=> Show (a,b,c,d,e,f,g,h,i,j,k,l,m) where
showsPrec _ (a,b,c,d,e,f,g,h,i,j,k,l,m) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h,
shows i, shows j, shows k, shows l, shows m] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k,
Show l, Show m, Show n)
=> Show (a,b,c,d,e,f,g,h,i,j,k,l,m,n) where
showsPrec _ (a,b,c,d,e,f,g,h,i,j,k,l,m,n) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h,
shows i, shows j, shows k, shows l, shows m, shows n] s
instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k,
Show l, Show m, Show n, Show o)
=> Show (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) where
showsPrec _ (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) s
= show_tuple [shows a, shows b, shows c, shows d, shows e, shows f, shows g, shows h,
shows i, shows j, shows k, shows l, shows m, shows n, shows o] s
>>20-21
Macros and type systems are completely different things.
Name:
FrozenVoid2011-10-23 17:03
>>22
Macros provide generic abstraction over the type system like void pointer are the generic(top) type for pointers.
#define add(a,b) a+b
//add()does not know about type of a,b
Name:
Anonymous2011-10-23 17:19
>>23 like void pointer are the generic(top) type for pointers.
That is a big NO there douche. Perhaps you should actually learn one of the ANSI/ISO C standards instead of googling shit. Cripes you suck. Go suck another dick you dildo.
Name:
Anonymous2011-10-23 18:21
>>22
Type system is a very limited and perverted form of macros.