Search found 5 matches

by mgcheung
Tue Jul 03, 2012 12:05 pm
Forum: Common Lisp
Topic: Writing a macro to define methods
Replies: 3
Views: 8289

Re: Writing a macro to define methods

To elaborate on what I'm trying to do, I'm trying to write an elliptic curve library, but I wanted to design it so that it will compute operations as efficiently as possible. The structures are for representations of points and the computations will depend on information about the curve and the fiel...
by mgcheung
Tue Jul 03, 2012 6:57 am
Forum: Common Lisp
Topic: Writing a macro to define methods
Replies: 3
Views: 8289

Writing a macro to define methods

Recently I asked about programmatically creating names for structs. I realized that I think I want to do something a little different. First, I'm not sure if the idea on how to do the task I have in mind is the right one. I was thinking of writing a macro that takes a name, creates two related struc...
by mgcheung
Sun Jul 01, 2012 4:03 am
Forum: Common Lisp
Topic: Questions about how lisp uses memory
Replies: 2
Views: 4945

Questions about how lisp uses memory

I have a few questions. If there is more than one variable with the same value, are there two places in memory with the same value or do they both point to the same address in memory? Also, is there any difference between having a constant value in a function vs getting the value from a parameter? A...
by mgcheung
Wed Jun 27, 2012 6:42 am
Forum: Common Lisp
Topic: Programmatically name a struct
Replies: 2
Views: 4924

Re: Programmatically name a struct

Thanks! The only change I made was to use the symb function from On Lisp since I had that code already.
by mgcheung
Tue Jun 26, 2012 7:15 am
Forum: Common Lisp
Topic: Programmatically name a struct
Replies: 2
Views: 4924

Programmatically name a struct

I was wondering if there was a way to create a new struct where the name of the struct is created programmatically. The idea is there is a constant part of the name and then a part of the name the user could specify. My thought would be to do something like (defstruct (symb 'const name) x y), but I ...