Questions tagged [eval-when]

A special operator you'll need to understand in order to write certain kinds of macros is EVAL-WHEN.eval-when normally appears as a top level form, but it is meaningful for it to appear as a non-top-level form. However, the compile-time side effects.

7 questions
15
votes
1 answer

In Common Lisp, when do you need to use eval-when, and how do you know?

A required use of eval-when is to ensure that functions which a macro depends on are available at the time the macro is compiled and is used. However, I can't think of an example that would demonstrate the consequences of not using…
anticrisis
  • 918
  • 1
  • 8
  • 17
15
votes
1 answer

Eval-when uses?

After reading a lot of documentation regarding Lisp eval-when operator I still can't understand its uses, I know with this operator I can control the evaluation time of my expressions but I can't figure out any example where this may be applicable…
utxeee
  • 953
  • 1
  • 12
  • 24
8
votes
2 answers

Common Lisp: How to get (in-package ...) to work from within Emacs Slime

64-bit Windows 7 Clozure Common Lisp Version 1.9 WindowsX8632 Emacs 24.3.1 Slime changelog date 2014-06-17 I have an example .lisp file which starts out as follows: (ql:quickload 'qt) (in-package "QT") The rest of the program shows a dialog…
Sonicsmooth
  • 2,673
  • 2
  • 22
  • 35
2
votes
1 answer

Cyclomatic Complexity - Cobol

I have to calculate Cyclomatic Complexity for a Cobol program that contains only an EVALUATE like this one: EVALUATE x WHEN x<0 ... WHEN x=0 ... WHEN x between 1 and 10 ... WHEN OTHER ...` END EVALUATE.` I have also to calculate…
Fede
  • 21
  • 1
0
votes
1 answer

How to properly use symbol property lists in common lisp macros

I am writing a Common Lisp macro define-computation which defines functions in a specific way and marks them by adding a property :computation to the property list of the symbol of the defined function. The define-computation is looking for forms…
Michaël Le Barbier
  • 6,103
  • 5
  • 28
  • 57
0
votes
1 answer

Loading quicklisp package for use in another lisp file

I have downloaded a large software project FriCAS which I have compiled from source and using SBCL. This was just a matter of using GNU .configure - I am a complete Lisp newbie. However, in order to add some further functionality I have - by very…
Alasdair
  • 1,300
  • 4
  • 16
  • 28
0
votes
1 answer

Comparing distinct items from collection in drools 6 when clause

I've searched around the internet but could not find an solution for a problem we are currently facing with drools (6.2.0). Suppose i have a rule like this: when $list: ProductList() $product: Product() from $list $product2: Product(this…
Kim Zeevaarders
  • 732
  • 1
  • 7
  • 21