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

if

Name: Anonymous 2008-01-12 16:36

how do i wrote if statements in LISP?

Name: Anonymous 2008-01-12 16:43

I can't really think of any sarcastic reply to this, so I'll give the real answer;

[code](if
  <if-cond>
  <if-sexp>
  <else-sexp> )

Name: Anonymous 2008-01-12 16:45

Ow, dicks!

(if
  <if-cond>
  <if-sexp>
  <else-sexp> )

Name: Anonymous 2008-01-12 16:50

>>2
>>3
why thank you

Name: Anonymous 2008-01-12 16:52


<if-cond>
(jp Z else)
<if-sexp>
(jp endif)
else:
<else-sexp>
endif:

Name: Anonymous 2008-01-12 16:57

>>5
Are you gay or what.

Name: Anonymous 2008-01-12 17:19

i tend to use cond more than if, even when i could use if.

Name: Anonymous 2008-01-12 17:21

>>5
Dijkstra wouldn't have liked this.

Name: Anonymous 2008-01-12 17:57

(when <cond>
   <s-exps>*)
(unless (not <cond>)
    <s-exps>*)


But you really should define a macro:
(defmacro .if (test if-true &body if-false)
   `(progn (when ,test ,if-true) (when (not ,test) ,@if-false)))

.IF
0] (.if t (print 3) (print 4))


NIL3
0]


Name: Anonymous 2008-01-12 17:58

ups:
(when cond ...) (unless cond ...)

Name: Anonymous 2008-01-12 18:02

>>9 You should not double evaluate things:


(defmacro .if (test if-true &body if-false)
   (let ((s-cond (gensym)))
      `(let ((,s-cond ,test))
          (when ,s-cond ,if-true)
          (unless ,s-cond ,@if-false))))



Name: Anonymous 2008-01-13 0:17

(if <condition> <then> <else>)

Name: Anonymous 2008-01-13 3:41

(if FUCK! <condition> .. ... ... ASS! <then> <elSHITCOCKse>)

My Lisp has Tourette's.

Name: Anonymous 2008-01-13 7:01

>>13
I have FUCK COCKTHUCKING GODDAMNED THITCOCKFATHE Tourette's with a lisp.

Name: T9OXx8q| !abelsoNcnA 2008-01-13 8:51

#T9OXx8q|

Name: Anonymous 2008-01-13 9:10

>>15
Nice.
% ./tripcode.py sussman
Looking for tripcode containing: sussman


;_;

Name: !PSuSSmANCE 2008-01-13 9:11

;_;

Name: Anonymous 2008-01-13 9:44

>>16
DO WANT

Name: !rRsUSSMANc 2008-01-13 10:12

s

Name: !!0cU4sgH4RgmebK1 2008-01-13 10:12

p

Name: !yQgQGk71zQ 2008-01-13 10:13

sepplesu ^_^

Name: Anonymous 2008-01-13 16:54

Wow. If statements are the easiest part of Lisp. Can anyone teach me to use OpenGL in Scheme?

Name: Anonymous 2008-01-13 16:55

>>22
You don't. OpenGL would mean you're potentially using a toy language for something useful, and that's impossible.

Name: Anonymous 2008-01-13 16:55

>>22
PLT scheme, gl in collects/ and the example games in examples/

Name: Anonymous 2008-01-13 16:58

>>22 here.

>>23
LOLNO. Gauche and PLT have opengl extensions.

>>24
I use Gauche :( Is it worth switching interpreter, or can you teach me to make HalfLife 2 in Scheme?

Name: Anonymous 2008-01-13 17:17

>>25
it\'s a 3d and physics engine with all sorts of fancy rendering capabilities. it would be easier just to create some scheme bindings on top of some open source engine.

Name: Anonymous 2008-01-13 17:23

>>26
I am aware of what OpenGL is. PLT and Gauche has libraries, but I think PLT might have superior documentation.

Name: Anonymous 2008-01-13 18:26

>>27
I might say that MzScheme may produce faster code. It's hard to say because I haven't seen benchmarks and I haven't tried Gauche first-hand, although I have been meaning to. PLT compiles to bytecode, and it also can do JIT compilation on x86 and some others, and it has more developers working on it. So my gut feeling is it might be faster. I'm not sure about its GL documentation, but it does have examples in the collects/ directory, wherever you installed it on your system of choice. It has a 3D Chess game among other things.

I think you misread what >>26 was saying. He was talking about the HalfLife 2 engine, I believe; not OpenGL. Basically if the engine is written in C or some ASM, then it will be uber fast and additionally, there's no need to re-invent all that great code when you can just make a wrapper for it.

Gauche might have better GL support, I'm not sure. PLT's is just an FFI library. I'd say try them both, and try >>26's suggestion.

Also noteworthy for those interested in writing games in functional languages: Haskell has nice GL support. There's a game written in it called 'Frag' that someone wrote for his undergraduate thesis. Google it!

Name: Anonymous 2008-01-13 18:32

Stop discussing about using toy languages for serious stuff, it doesn't make them any less toy.

Name: Anonymous 2008-01-13 18:34

>>29
Dijkstra wouldn't have liked this attitude.

Name: Anonymous 2008-01-14 2:23

fluxus

Name: Anonymous 2009-03-06 8:04


The end based on   additional knowledge of   the problem common   sense or trial.

Name: wedding-d 2010-07-06 4:45


I got an <a href="http://www.maternityweddingdressesshop.com" title="wholesale Wedding Dresses">maternity wedding dresses</a> engagement ring for Christmas. My <a href="http://www.maternityweddingdressesshop.com" title="wholesale Wedding Dresses">maternity wedding dresses</a> boyfriend and I had been dating for almost a year and both felt the time was <a href="http://www.maternityweddingdressesshop.com" title="wholesale Wedding Dresses">maternity wedding dresses</a>right to join our lives together in holy matrimony. htmlThe month of January was spent planning our <a href="http://www.wholesale-promgowns.com " title="wholesale Wedding Dresses">wholesale prom gowns</a> perfect Alabama June wedding. My mother, two sisters and I went to Huntsville, the closest <a href="http://www.maternityweddingdressesshop.com" title="wholesale Wedding Dresses">maternity wedding dresses</a> town with a selection of bridal shops, to buy the gown that would play the leading role on my special occasion.We <a href="http://www.wholesale-promgowns.com " title="wholesale Wedding Dresses">wholesale prom gowns</a> had a wonderful time just being together and sharing silly jokes, but the <a href="http://www.wholesale-promgowns.com " title="wholesale Wedding Dresses">wholesale prom gowns</a> day soon turned serious by afternoon: still no sign of the dress of my dreams. Both sisters were ready to give <a href="http://www.wholesale-promgowns.com " title="wholesale Wedding Dresses">wholesale prom gowns</a> up and try another day in another town, but I coerced them into one more boutique.I had a good feeling as we entered the quaint little <a href="http://www.maternityweddingdressesshop.com" title="wholesale Wedding Dresses">maternity wedding dresses</a> shop filled with the scent of fresh flowers. The elderly clerk showed us several <a href="http://www.wholesale-promgowns.com " title="wholesale Wedding Dresses">wholesale prom gowns</a> beautiful gowns in my size <a href="http://www.wholesale-promgowns.com " title="wholesale Wedding Dresses">wholesale prom gowns</a> and price range, but none were right. As I opened the door to leave, the desperate shop owner announced she had one more dress in the back that was expensive and <a href="http://www.maternityweddingdressesshop.com" title="wholesale Wedding Dresses">maternity wedding dresses</a> not even my size, but perhaps I <a href="http://www.wholesale-promgowns.com " title="wholesale Wedding Dresses">wholesale prom gowns</a> might want to look at it anyway. When she brought it out, I squealed in delight.

Name: Anonymous 2010-07-06 5:37

first class if

Name: Anonymous 2010-07-06 8:29

JEWS

Name: Anonymous 2010-07-06 9:33

>>34
Ok, then what?

Name: Anonymous 2011-02-03 2:53


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