• R/O
  • HTTP
  • SSH
  • HTTPS

Thun: Commit

Interpreter and library.


Commit MetaInfo

Révision89550cdd5fb80cbefc9adf8e642a8ee0add90520 (tree)
l'heure2021-11-29 06:41:19
AuteurSimon Forman <sforman@hush...>
CommiterSimon Forman

Message de Log

Change Summary

Modification

--- a/docs/Zipper.ipynb
+++ b/docs/Zipper.ipynb
@@ -353,7 +353,55 @@
353353 },
354354 {
355355 "cell_type": "code",
356- "execution_count": 15,
356+ "execution_count": 4,
357+ "metadata": {},
358+ "outputs": [
359+ {
360+ "name": "stdout",
361+ "output_type": "stream",
362+ "text": []
363+ }
364+ ],
365+ "source": [
366+ "clear"
367+ ]
368+ },
369+ {
370+ "cell_type": "code",
371+ "execution_count": 2,
372+ "metadata": {},
373+ "outputs": [
374+ {
375+ "name": "stdout",
376+ "output_type": "stream",
377+ "text": [
378+ "[Q] [dip dip infra dip infra dip infra]"
379+ ]
380+ }
381+ ],
382+ "source": [
383+ "[Q] [dip dip infra dip infra dip infra]"
384+ ]
385+ },
386+ {
387+ "cell_type": "code",
388+ "execution_count": null,
389+ "metadata": {},
390+ "outputs": [],
391+ "source": [
392+ "[unit cons] step"
393+ ]
394+ },
395+ {
396+ "cell_type": "markdown",
397+ "metadata": {},
398+ "source": [
399+ "So that's broken with the current definition of `step` but this works:"
400+ ]
401+ },
402+ {
403+ "cell_type": "code",
404+ "execution_count": 6,
357405 "metadata": {},
358406 "outputs": [
359407 {
@@ -368,6 +416,181 @@
368416 },
369417 {
370418 "cell_type": "code",
419+ "execution_count": 7,
420+ "metadata": {},
421+ "outputs": [
422+ {
423+ "name": "stdout",
424+ "output_type": "stream",
425+ "text": [
426+ "[Q] [[dip] [dip] [infra] [dip] [infra] [dip] [infra]]"
427+ ]
428+ }
429+ ],
430+ "source": [
431+ "[Q] [[dip] [dip] [infra] [dip] [infra] [dip] [infra]]"
432+ ]
433+ },
434+ {
435+ "cell_type": "code",
436+ "execution_count": 8,
437+ "metadata": {},
438+ "outputs": [
439+ {
440+ "name": "stdout",
441+ "output_type": "stream",
442+ "text": [
443+ "[[[[[[[[Q] dip] dip] infra] dip] infra] dip] infra]"
444+ ]
445+ }
446+ ],
447+ "source": [
448+ "[cons] step"
449+ ]
450+ },
451+ {
452+ "cell_type": "markdown",
453+ "metadata": {},
454+ "source": [
455+ "Do I want to revisit `step` def? Insist that `Z` use `[[A][B][C]...]` rather than `[A B C ...]`? Seems clunky, special-cased, and not in the spirit of the thing, eh?\n",
456+ "\n",
457+ "Arguably,\n",
458+ "\n",
459+ " [dip dip infra dip infra dip infra] [unit cons] step\n",
460+ "\n",
461+ "*should* work, yes?\n",
462+ "\n",
463+ "\n",
464+ " ... [] [Q] . step\n",
465+ " -----------------------\n",
466+ " ... .\n",
467+ "\n",
468+ "\n",
469+ " ... [a] [Q] . step\n",
470+ " ------------------------\n",
471+ " ... a . Q\n",
472+ "\n",
473+ "\n",
474+ " ... [a b c] [Q] . step\n",
475+ " ----------------------------------------\n",
476+ " ... a . Q [b c] [Q] step\n",
477+ "\n"
478+ ]
479+ },
480+ {
481+ "cell_type": "code",
482+ "execution_count": 9,
483+ "metadata": {},
484+ "outputs": [
485+ {
486+ "name": "stdout",
487+ "output_type": "stream",
488+ "text": []
489+ }
490+ ],
491+ "source": [
492+ "clear"
493+ ]
494+ },
495+ {
496+ "cell_type": "code",
497+ "execution_count": 10,
498+ "metadata": {},
499+ "outputs": [
500+ {
501+ "name": "stdout",
502+ "output_type": "stream",
503+ "text": [
504+ "[dip dip infra dip infra dip infra]"
505+ ]
506+ }
507+ ],
508+ "source": [
509+ "[dip dip infra dip infra dip infra]"
510+ ]
511+ },
512+ {
513+ "cell_type": "code",
514+ "execution_count": 11,
515+ "metadata": {},
516+ "outputs": [
517+ {
518+ "name": "stdout",
519+ "output_type": "stream",
520+ "text": [
521+ "[[dip] dip infra dip infra dip infra]"
522+ ]
523+ }
524+ ],
525+ "source": [
526+ "[unit] infra"
527+ ]
528+ },
529+ {
530+ "cell_type": "code",
531+ "execution_count": null,
532+ "metadata": {},
533+ "outputs": [],
534+ "source": []
535+ },
536+ {
537+ "cell_type": "code",
538+ "execution_count": null,
539+ "metadata": {},
540+ "outputs": [],
541+ "source": []
542+ },
543+ {
544+ "cell_type": "code",
545+ "execution_count": null,
546+ "metadata": {},
547+ "outputs": [],
548+ "source": []
549+ },
550+ {
551+ "cell_type": "code",
552+ "execution_count": null,
553+ "metadata": {},
554+ "outputs": [],
555+ "source": []
556+ },
557+ {
558+ "cell_type": "code",
559+ "execution_count": null,
560+ "metadata": {},
561+ "outputs": [],
562+ "source": []
563+ },
564+ {
565+ "cell_type": "code",
566+ "execution_count": null,
567+ "metadata": {},
568+ "outputs": [],
569+ "source": []
570+ },
571+ {
572+ "cell_type": "code",
573+ "execution_count": null,
574+ "metadata": {},
575+ "outputs": [],
576+ "source": []
577+ },
578+ {
579+ "cell_type": "code",
580+ "execution_count": null,
581+ "metadata": {},
582+ "outputs": [],
583+ "source": []
584+ },
585+ {
586+ "cell_type": "code",
587+ "execution_count": null,
588+ "metadata": {},
589+ "outputs": [],
590+ "source": []
591+ },
592+ {
593+ "cell_type": "code",
371594 "execution_count": 6,
372595 "metadata": {},
373596 "outputs": [
--- a/joy/library.py
+++ b/joy/library.py
@@ -201,9 +201,9 @@ class Def(object):
201201 if line.lstrip().startswith('#'):
202202 continue
203203 name, body = text_to_expression(line)
204- if name not in dictionary:
205- inscribe(class_(name, body), dictionary)
206-## inscribe(class_(name, body), dictionary)
204+## if name not in dictionary:
205+## inscribe(class_(name, body), dictionary)
206+ inscribe(class_(name, body), dictionary)
207207
208208
209209 #
Afficher sur ancien navigateur de dépôt.