Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

CL is cryptic

Name: Anonymous 2011-08-03 5:11

I'm trying to define export-defun macro, that would automatically export defined function, but produces error "These symbols are not accessible in the XYZ package" with ASDF. How would you fix it?


(defmacro export-defun (pkg name args &body body)
  (unless (find-package pkg)
    (make-package pkg))
  (let ((sym (intern (symbol-name name) pkg)))
    `(progn (defun ,sym ,args ,@body)
            (export ',sym))))

Name: Anonymous 2011-08-03 6:16

How would you fix it?
Use C89.

Name: Anonymous 2011-08-03 7:49

>>2
doesnt work.

Name: Anonymous 2011-08-03 10:02

6c6
< (export ',sym)
---
(export ',sym ',pkg)

Name: Anonymous 2011-08-03 13:53

What >>4 said, but
Why do you need to do this? You can just export the symbol in the package definition form, and if you want to write your code from another package, you can always:

(defun your-package:your-function (...) ...)

Name: Anonymous 2011-08-03 18:34

>>4
Thanks. It works now.

>>5
I dont like hand-updating two places, when a single symbol changes.

Name: Anonymous 2011-08-04 11:13

What colors are missing?


in gfx

// variations of red
m:red        -> #FF0000
m:medium_red -> #7F0000
m:dark_red   -> #3F0000
m:weak_red   -> #FF7F7F

m:brown      -> #964B00
m:dark_brown -> #654321
m:weak_brown -> #987654


// variations of green
m:green        -> #00FF00
m:medium_green -> #007F00
m:dark_green   -> #003F00
m:weak_green   -> #7FFF7F

// variations of blue
m:blue        -> #0000FF
m:medium_blue -> #00007F
m:dark_blue   -> #00003F
m:weak_blue   -> #7F7FFF

// variations of yellow
m:yellow -> #FFFF00
m:orange -> #FF7F00
m:olive  -> #7F7F00

// variations of cyan
m:cyan   -> #00FFFF
m:azure  -> #007FFF
m:teal   -> #007F7F

// variations of magenta
m:magenta -> #FF00FF
m:pink    -> #FF007F
m:violet  -> #7F00FF
m:purple  -> #7F007F

// variations of gray
m:black       -> #000000
m:gray        -> #7F7F7F
m:silver      -> #C0C0C0
m:weak_silver -> #C9C0BB
m:white       -> #FFFFFF

Name: Anonymous 2011-08-04 17:03

16777186 of them.

Name: Anonymous 2011-08-05 0:27

>>8
I meant colors that have english names.

Name: Anonymous 2011-08-05 1:18

>>9
Feldgrau

( ≖‿≖)

Name: Anonymous 2011-08-05 5:57

>>10
Too domain specific.
I'm not doing framework for WWII games.
Just want a few predefined colors in standard library.

Name: Anonymous 2011-08-05 6:11

What is the name of #00ff7f?

Name: Anonymous 2011-08-05 7:25

Just use X11 color names, christ.

Name: Anonymous 2011-08-05 12:54

Just use Emacs color names, christ.

Name: HAXUS THE BRITISH 2011-08-05 13:01

The correct spelling is `colour', stupid rednecks.

Name: Anonymous 2011-08-05 13:12

>>15
British couldn't even keep control of its colonies. Stupid weak ass faggots.

Name: Anonymous 2011-08-05 14:14

>>15
Who do you think standardized the English language? If you read any pre-US letters, documents and literature you'll notice that there is no consistency. Yet, if you look at the first US documents, i.e. The Declaration of Independence, The Constitution, etc. you'll notice it's very consistent with modern English. That's because English wasn't standardized until the US decided to standardize it in order to make such documents more specific in their meaning.

Obviously it's no coincidence that British English is 99.999% the same as US English. They adopted it and that they fucked up a handful of words like color is their problem.

Name: Anonymous 2011-08-05 14:32

>>17
Try reading some Shakespeare.

Name: Anonymous 2011-08-05 14:32

>>17,18
Remember to sage your posts for the benefit of all /prog/ users.

Name: Anonymous 2011-08-05 14:33

>>18
Shakespeare was an American.

Name: Anonymous 2011-08-05 14:54

>>20
And Thomas Edison was British.

Name: Anonymous 2011-08-05 14:56

>>21
No, he was African.

Don't change these.
Name: Email:
Entire Thread Thread List