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

Pages: 1-

Can common lisp do THIS?

Name: Anonymous 2018-01-10 13:47

(define-syntax toaster
(lambda (stx)
(syntax-case stx ()
[(_ x) #'"toasted something"]
[(_) #'"toasted nothing"]
[_ #'"this is a toaster"])))

(display toaster)
(newline)
(display (toaster))
(newline)
(display (toaster a))
(newline)


Scheme wins again.

Name: Anonymous 2018-01-10 13:49

Clojure can

Name: Anonymous 2018-01-10 14:16

>>2
Can it? Its macros seem quite similar to the classical lisp ones.

Name: Anonymous 2018-01-10 15:42

I fail to see how this can't be done with a macro

Name: Anonymous 2018-01-10 22:30

>>4
Try and do it then.

Name: Anonymous 2018-01-11 0:42

>>4
I fail
I really having nothing to add.

Name: Anonymous 2018-01-11 1:31

>>4
I fail
epic

Name: Anonymous 2018-01-11 12:38

That's cute, but syntax-case is not defined in da standard.

Name: Anonymous 2018-01-11 14:12

>>8
R6RS is the only true standard.

Name: Anonymous 2018-01-11 14:12

>>4
I'd like to see that.

Name: Anonymous 2018-01-11 14:13

>>9
Yes it is.

Name: Anonymous 2018-01-11 14:13

I'd like to see dubs

Name: Anonymous 2018-01-13 17:15

Looks like Scheme wins again!

Name: Anonymous 2018-01-14 8:01

Symta can, but (display toaster) requires defining toaster through mexlet, which, just like symbol-macrolet in Common Lisp, defines local syntatic constant:
toaster @Xs = case Xs
[_ X] | 'toasted something'
[_] | 'toasted nothing'

export \toaster
...

mexlet toaster 'this is a toaster'
| say toaster
| say: toaster
| say: toaster a

Name: Anonymous 2018-01-14 8:02

>>14

Oops! Forgot to strip Schemes ugly '_', which Symta doesn't require

Name: Anonymous 2018-01-14 8:05

>>15
Here is how mexlet used in real Symta code to define C++ style for-loop:
expand_loop Head Post Body =
| L = @rand l
| Post = if got Post then [Post] else []
| Break = []
| when Body^has_head{pass}:
| Pass = @rand pass
| Body <= [mexlet [pass] [_goto Pass] Body]
| push [_label Pass] Post
| when Body^has_head{done}:
| Done = @rand done
| Body <= [mexlet [done] [_goto Done] Body]
| push [_label Done] Break
| [_progn [_label L]
[_if Head
[_progn Body @Post [_goto L]]
No]
@Break]

for @As = case As
[Item Items Body] | expand_map_for times Item Items Body
[[`;` Entry Cond Post] Body]
| ['|' Entry (expand_loop Cond Post Body)]
Else
| mex_error "`for` has bad syntax [As]"

Name: Anonymous 2018-01-14 11:54

Nikita, do you know if common lisp can do it?

Name: Anonymous 2018-01-14 12:39

>>17
Common Lisp is turing complete

Name: Anonymous 2018-01-14 14:55

>>18
Brainfuck is turing complete but it can't do it.

Name: Anonymous 2018-01-15 0:13

>>19
What about ur mom?

Name: Anonymous 2018-01-15 7:48

>>14,16
can you use mexlets to make your game?

Name: Anonymous 2018-01-15 9:35

>>20
What does an ancient Sumerian city's mother have to do with this?

Name: Anonymous 2018-01-15 10:21

>>22
sumerians are turing complete according to snow crash

Name: Anonymous 2018-01-15 11:18

>>23
Now that's a vintage meme if I've ever seen one!

Name: Anonymous 2018-01-15 11:23

>>24
thanks, I'm a conoisseur of old-school, retro and vintage maymays

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